Skip to content

Commit

Permalink
Conditionally set Content-Type only when we are sending data (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melonify authored Apr 3, 2023
1 parent 67285a8 commit 9975286
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/worker/worker.http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ async function doRequest<T = object>(base: string, path: string, method?: string
return fetch(`${base}/${path}`, {
method,
body: body ? JSON.stringify(body) : undefined,
headers: body
? {
"Content-Type": "application/json",
}
: undefined,
referrer: location.origin,
referrerPolicy: "origin",
}).then(async (resp) => {
Expand Down

0 comments on commit 9975286

Please # to comment.