Skip to content

Commit

Permalink
feat: add header for snapshot-hub webhook verification
Browse files Browse the repository at this point in the history
  • Loading branch information
jtrein committed Jan 11, 2024
1 parent 5a19528 commit 3074f43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ const getSubscribersFromFile = async (): Promise<Subscribers> => {

async function sendEvent(event, to) {
try {
await axios.post(to, event);
await axios.post(to, event, {
headers: {
'x-snapshot-hub-verify': process.env.WEBHOOK_VERIFY
}
});
} catch (error) {
const BASE_ERROR = `Failed to send event to ${to}`;

Expand Down

0 comments on commit 3074f43

Please sign in to comment.