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

Content-Type inferred from body is overridden if headers are given as object #1076

Open
en30 opened this issue Oct 31, 2021 · 0 comments
Open

Content-Type inferred from body is overridden if headers are given as object #1076

en30 opened this issue Oct 31, 2021 · 0 comments

Comments

@en30
Copy link

@en30 en30 commented Oct 31, 2021

Actual Behaviour

When fetch as below,

fetch("/foo", {
 method: "POST",
 headers: {
   "Accept": "text/html"
 },
 body: new URLSearchParams("bar=1")
})

the request's Content-Type header value is text/plain;charset=UTF-8 since #798.

Expected behavior

The request's Content-Type header value is application/x-www-form-urlencoded;charset=UTF-8.

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

1 participant