Skip to content

Commit ce2c695

Browse files
committed
refactor(notifications): simplify webhook URL validation logic
Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me>
1 parent 4fc89ed commit ce2c695

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

  • src/components/Settings/Notifications/NotificationsWebhook

src/components/Settings/Notifications/NotificationsWebhook/index.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,7 @@ const NotificationsWebhook = () => {
119119
intl.formatMessage(messages.validationWebhookUrl),
120120
function (value) {
121121
const { supportVariables } = this.parent;
122-
123-
// allow variable syntax through
124-
if (
125-
supportVariables &&
126-
typeof value === 'string' &&
127-
value.includes('{{')
128-
) {
129-
return true;
130-
}
131-
132-
// otherwise fall back to the built‑in URL check
133-
return isValidURL(value);
122+
return supportVariables || isValidURL(value);
134123
}
135124
),
136125

0 commit comments

Comments
 (0)