Skip to content

Commit

Permalink
Add alternative for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-lippert authored May 15, 2024
1 parent 7dbffc7 commit ec79696
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 @@ -61,7 +61,7 @@ export class State {
if (callback) {
const callbacks = Array.isArray(callback) ? callback : [callback]
for (let i = 0; i < callbacks.length; i++) {
const url = typeof callbacks[i] === 'string' || callbacks[i] instanceof String ? callbacks[i] : callbacks[i].url
const url = typeof callbacks[i] === 'string' || callbacks[i] instanceof String ? callbacks[i] : (callbacks[i].url || callbacks[i].callback)
const init = callbacks[i].init || meta?.init || {}
init.headers = callbacks[i].headers || meta?.headers || init.headers || {}
// Check if the callback has a body (cascade: callback > meta > init > event)
Expand Down

0 comments on commit ec79696

Please sign in to comment.