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

URLSearchParams passed to Request does not set the correct body and headers #965

Closed
romainmenke opened this issue Jul 23, 2021 · 6 comments

Comments

@romainmenke
Copy link

romainmenke commented Jul 23, 2021

This is essentially the same issue as : #674

A similar wrapper for Request might resolve this.
Request being a constructor whereas fetch is just a function might complicate things :/

see : mrhenry/web-tests#171

(maybe this should not be fixed here, that is also fine!)

@zloirock
Copy link
Owner

zloirock commented Jul 23, 2021

Thanks for the report. Could you add a PR?

@romainmenke
Copy link
Author

I have some time this weekend and will give it a shot!
Thank you for the quick response :)

@romainmenke
Copy link
Author

Still not sure about patching Request in core-js.
Having some non-ecma features in core-js complicates things and don't really want to expand that surface.

Hoping to resolve this through : JakeChampion/polyfill-library#1077

@zloirock
Copy link
Owner

It should be solved by patching of Request since it should work with any implementation and bad support of URLSearchParams is not a reason to polyfill fetch / Request.

@romainmenke
Copy link
Author

Thank you @zloirock

Seeing the final code I don't think I would have gotten there smoothly :)
You are also right that this should be fixed for any fetch implementation.

@romainmenke
Copy link
Author

Thank you fo the quick release.
First test results indicate that this is now working for a lot more browsers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants