Skip to content

Commit

Permalink
Merge pull request #1611 from gchq/bugfix/webhook-fix
Browse files Browse the repository at this point in the history
Bugfix/webhook fix
  • Loading branch information
JR40159 authored Nov 5, 2024
2 parents 3eb13fa + 719bdc2 commit 33a86b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"content-disposition": "^0.5.4",
"dedent-js": "^1.0.1",
"dev-null": "^0.1.1",
"express": "^5.0.1",
"express": "5.0.1",
"express-session": "^1.18.0",
"fflate": "^0.8.2",
"grant": "^5.4.22",
Expand Down
9 changes: 7 additions & 2 deletions backend/src/services/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,15 @@ export async function sendWebhooks(
agent: getHttpsAgent({
rejectUnauthorized: webhook.insecureSSL,
}),
headers,
headers: { 'Conent-Type': 'application/json', ...headers },
})
if (!response.ok) {
log.error({ eventKind, response }, 'Non 200 response received when sending Webhook.')
log.error(
{ eventKind, response: { status: response.status, body: await response.text() } },
'Non 200 response received when sending Webhook.',
)
} else {
log.debug('Successfully sent webhook', { webhook, event: eventKind })
}
} catch (err) {
log.error({ eventKind, err }, 'Unable to send Webhook.')
Expand Down

0 comments on commit 33a86b1

Please sign in to comment.