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 - document known differences from the spec #3578

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

Fetch - document known differences from the spec #3578

Aprillion opened this issue Feb 20, 2022 · 5 comments
Assignees
Labels
documentation Documentation edits

Comments

@Aprillion
Copy link

As of 2022-02-20, https://developers.cloudflare.com/workers/runtime-apis/fetch only points to MDN and does not mention any differences from the fetch specification.

I found 2 issues so far (while working on https://github.com/Aprillion/stampy-ui/commits/master), both worked fine in miniflare (which uses undici), but not after deployment to CF workers:

Please let me know if these are bugs to be fixed (and if so, where can I report more issues in the future, please), or if these differences happen on purpose and should be documented (if so, I can work on a PR, but let me also know whether to open a sister issue in miniflare to make sure our local dev environment will match all these fetch quirks, debugging these differences in production was not ideal TBH)...

@Aprillion
Copy link
Author

This sounds related: https://developers.cloudflare.com/workers/platform/compatibility-dates#new-url-parser-implementation, but it's not enabled by default (and not sure if it affects the first fetch parameter too), so the default DX might still be confusing (something works locally and breaks after deployment => it's open to hard to debug issues non-reproducible locally).

@hansede
Copy link

hansede commented Mar 3, 2022

This is related: cloudflare/miniflare#183
Undici's fetch removes set-cookie headers from the response, but Cloudflare's doesn't.

@hansede
Copy link

hansede commented Mar 3, 2022

Another way in which Undici's fetch behaves differently from Cloudflare's fetch is that Cloudflare adds the X-Forwarded-For header, but Undici does not.

@jasnell
Copy link
Member

jasnell commented Mar 10, 2022

Hey all, yeah there are a couple of places where the Workers fetch() does diverge from the standard. The goal will be to close those gaps fairly soon (no specific timeline yet but they're on my roadmap).

@jkup
Copy link
Contributor

jkup commented Mar 11, 2022

Hey @Aprillion! Thanks for reporting this. For context, @jasnell has been leading the charge on identifying and fixing these divergences. As he mentioned, we don't have a specific timeline for getting fetch() to 100% compliance but it's definitely on our list and we should be getting to it soon! Thanks again for reporting.

@jkup jkup closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation edits
Projects
None yet
Development

No branches or pull requests

6 participants