cloudflare / miniflare

🔥 Fully-local simulator for Cloudflare Workers. For the latest version, see https://github.com/cloudflare/workers-sdk/tree/main/packages/miniflare.
https://miniflare.dev
MIT License
3.78k stars 205 forks source link

[Miniflare 3] Allow `GET` requests with bodies in entry worker #677

Closed mrbbot closed 1 year ago

mrbbot commented 1 year ago

Hey! 👋 Whilst prohibited by the Request API spec, GET requests are allowed to have bodies. If Content-Length or Transfer-Encoding are specified, workerd will give the request a (potentially empty) body. Passing a bodied-GET-request through to the new Request() constructor should throw, but workerd has special handling to allow this if a Request instance is passed.

Miniflare was previously decomposing the request before passing it back to the new Request() constructor, defeating this detection. This change ensures we always pass full Request instances to the new Request() constructor in the entry worker.

Closes cloudflare/workerd#1122

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: c771499b8414f0fdb4882c5b8202c21395e952d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR