Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions node-typescript/github-issue-bot/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ class GithubService {
async verifyWebhook(req: any): Promise<boolean> {
const signature = req.headers['x-hub-signature-256'];

return (
typeof signature !== 'string' ||
(await verify(process.env.GITHUB_WEBHOOK_SECRET, req.bodyBinary, signature))
if (typeof signature !== 'string') {
return false;
}

return await verify(
process.env.GITHUB_WEBHOOK_SECRET,
req.bodyBinary,
signature
);
}

Expand Down
11 changes: 8 additions & 3 deletions node/github-issue-bot/src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ class GithubService {
async verifyWebhook(req) {
const signature = req.headers['x-hub-signature-256'];

return (
typeof signature !== 'string' ||
(await verify(process.env.GITHUB_WEBHOOK_SECRET, req.bodyBinary, signature))
if (typeof signature !== 'string') {
return false;
}

return await verify(
process.env.GITHUB_WEBHOOK_SECRET,
req.bodyBinary,
signature
);
}

Expand Down