Skip to content

Commit

Permalink
fix(workers-playground): sends raw request method through the X-CF-HT…
Browse files Browse the repository at this point in the history
…TP-Method header (#7639)
  • Loading branch information
edmundhung authored Jan 15, 2025
1 parent 902e3af commit 99f27df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-news-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"workers-playground": patch
---

fix: sends raw request method through the X-CF-HTTP-Method header
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export function fetchWorker(

return fetch(`${proxyUrl.origin}${init}`, {
...input,
method: "POST",
headers: [
...(input?.headers ?? [])
.filter(([name]) => name)
.map<[string, string]>(([n, v]) => [`cf-ew-raw-${n}`, v]),
["X-CF-Token", token],
["cf-raw-http", "true"],
["X-CF-HTTP-Method", input.method ?? "GET"],
],
});
}

0 comments on commit 99f27df

Please sign in to comment.