Skip to content

Commit

Permalink
Update worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-lippert authored Nov 22, 2023
1 parent 20c41d4 commit a0ddd89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class State {
const init = callbacks[i].init || meta?.init || {}
init.headers = { 'content-type': 'application/json', ...(callbacks[i].headers || meta?.headers || init.headers) }
init.method = callbacks[i].method || meta?.method || init.method || 'POST'
init.body = JSON.stringify(callbacks[i].body || meta?.body || state.event)
if (['POST', 'PUT', 'PATCH'].includes(init.method)) init.body = JSON.stringify(callbacks[i].body || meta?.body || state.event)
console.log({ url, init, state })
const data = await fetch(url, init)
// Escape special regex characters and replace x with \d to check if the callback status code matches an event (e.g. 2xx)
Expand Down

0 comments on commit a0ddd89

Please sign in to comment.