Skip to content

Commit

Permalink
fix(worker): get request cannot have a body
Browse files Browse the repository at this point in the history
  • Loading branch information
oddyamill committed Sep 17, 2024
1 parent ef6b565 commit 931cace
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/worker/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ function proxy(url: URL, request: Request, cf?: CfProperties) {
const init: RequestInit = {
headers: request.headers,
method: request.method,
body: request.body,
redirect: "manual",
cf,
}

if (request.method === 'POST') {
init.body = request.body
}

return fetch(url, init)
}

Expand Down

0 comments on commit 931cace

Please sign in to comment.