fetch-wrap
fetch-wrap copied to clipboard
Using the Header object breaks header merging
Using the header object in a fetch call
headers: new Headers(
{
"Content-Type": "application/json",
}
),
instead of just
headers: {
"Content-Type": "application/json",
}
will cause the merging of headers as show in the documentation to fail. Only the header(s) given in the fetch call will be used.
If a fix or warning for this is not desirable, could it be at least mentioned in the documentation? Depending on which solution you prefer I will gladly create a pull request.
sorry for the delay, just saw this. if feasible (and by glancing at Headers
object API it seems like it should), I'd try to support it, accepting any (Headers
object or plain object) transparently.
pull-request would be welcome 👍
Sorry for the wayyyy longer delay on my side. But once I was working around the problem, your library did just fit in perfectly, so I never thought about it again. I will try to look into it in the next weeks and set up a pull request.