Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch shouldn't be different from CF workers #182

Closed
Aprillion opened this issue Feb 20, 2022 · 3 comments
Closed

Fetch shouldn't be different from CF workers #182

Aprillion opened this issue Feb 20, 2022 · 3 comments
Labels
behaviour mismatch Different behaviour to Workers runtime
Milestone

Comments

@Aprillion
Copy link

There are differences in URL parsing and other aspects of fetch in CF workers and the specification. As of 2022-02-20, miniflare is using the standards-compliant undici implementation, not the CF implementation. We should switch to the CF version of fetch to improve DX (it's hard to debug issues that only happen in production and aren't reproducible locally).

See examples in cloudflare/cloudflare-docs#3578 (issue for documenting those differences, so developers can learn about those).

@hansede
Copy link

hansede commented Mar 3, 2022

Cloudflare behaves like a reverse proxy, but Undici is not a reverse proxy, it's an HTTP client. I'm hoping we can get Cloudflare's actual fetch implementation in Miniflare, but in lieu of that a reverse proxy library like http-proxy-middleware could be a good alternative to Undici.

@mrbbot
Copy link
Contributor

mrbbot commented Mar 4, 2022

Hey! 👋 Thanks for raising this and apologies for the delayed response. Unfortunately, Cloudflare's fetch implementation isn't open-source and isn't designed to be integrated with Node.js. Cloudflare's fetch URL parser should soon be more spec-compliant though, so hopefully things will improve...

@mrbbot mrbbot added the behaviour mismatch Different behaviour to Workers runtime label Mar 4, 2022
@mrbbot mrbbot added this to the 2.4.0 milestone Mar 8, 2022
@mrbbot mrbbot modified the milestones: 2.4.0, 2.5.0 Apr 2, 2022
@mrbbot mrbbot modified the milestones: 2.5.0, 2.6.0 May 27, 2022
@mrbbot mrbbot modified the milestones: 2.6.0, 2.7.0 Jul 9, 2022
@mrbbot mrbbot modified the milestones: 2.7.0, 2.8.0 Aug 19, 2022
@mrbbot mrbbot modified the milestones: 2.8.0, 🔮 3.0.0? Sep 3, 2022
@mrbbot
Copy link
Contributor

mrbbot commented Oct 17, 2022

Hey! 👋 This issue should be fixed in Miniflare 3, which is powered by the open-source Workers runtime workerd.

@mrbbot mrbbot closed this as completed Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behaviour mismatch Different behaviour to Workers runtime
Projects
Archived in project
Development

No branches or pull requests

3 participants