-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Pass unknown options to fetch #536
Pass unknown options to fetch #536
Conversation
76d87eb
to
7b2516b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great implementation. It's about as simple as you could make it, given the silly dance we have to do here.
I was originally thinking we would maintain a list of known request options to use for filtering, which I really did not want to do. But I see that the request class exposes most (all?) of its constructor options as instance properties and you are using that to avoid hardcoding the list. Nice work.
Technically, we could allow the Ky options to be passed on to fetch()
and it likely wouldn't cause any trouble, at least in browsers. Although, there could be environments where fetch()
throws for unexpected options. So doing it this way is certainly safer. 👍
@doroved , please create a separate issue and provide all the details of what you think needs to be done. |
This PR implements option number 2 of this comment by @sholladay.
Fixes #531
Fixes #516
Also, tested this against Next.js v13.5.5 patched fetch and I can verify that it works.