Skip to content

Commit 381808f

Browse files
committed
Enhance webhook validation by ensuring endpoint is provided when enabled in project and user notifications
1 parent 3d9de27 commit 381808f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/resolvers/projectNotifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ async function validateNotificationsRuleChannels(channels: NotificationsChannels
127127
}
128128
}
129129

130-
if (channels.webhook?.isEnabled) {
130+
if (channels.webhook?.isEnabled && channels.webhook.endpoint) {
131131
const webhookError = await validateWebhookEndpoint(channels.webhook.endpoint);
132132

133133
if (webhookError !== null) {

src/resolvers/userNotifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747
{ input }: ChangeUserNotificationsChannelPayload,
4848
{ user, factories }: ResolverContextWithUser
4949
): Promise<ChangeNotificationsResponse> {
50-
if (input.webhook?.isEnabled) {
50+
if (input.webhook?.isEnabled && input.webhook.endpoint) {
5151
const webhookError = await validateWebhookEndpoint(input.webhook.endpoint);
5252

5353
if (webhookError !== null) {

0 commit comments

Comments
 (0)