The User-Agent header has not been forbidden since Firefox 43 (see https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name).
> Note: The User-Agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in Firefox 43) — it can now be set in a Fetch Headers object, or via XHR setRequestHeader().
I've had success setting it in Firefox and Edge for `fetch` and it should work for XMLHttpRequest as well but I'm too lazy to look up how to use XMLHttpRequest. I haven't had any luck setting User-Agent it in Chrome yet - may be a Chrome bug - but I'm not seeing any warnings in the terminal when I use it either, so I don't think allowing it will cause any spurious warnings.
Passing an array as a header value now works as in node.
Header handling with multiple values for the same header is also
tested, and mime type test updated for safari 10.1
Fixes#73
Instead of only permitting bodies on certain methods, only
prohibit them when the browser would give an error (with fetch)
or ignore them (with XHR). This allows bodies with custom
methods and is closer to the behavior of http in node.
Fixes#69
Errors that occur while reading from the ReadableStream that is returned as part of a `fetch` request were not handled. This change propagates these errors up to the `ClientRequest`.
Previously, there was some logic to use the page host
when possible, but it was problematic still (e.g. #53).
Just use example.com in all cases instead. Since the
request is never sent, this shouldn't cause extra
network traffic (except perhaps a dns lookup).
Fixes#53
This fixes some more edge cases when converting from a Buffer to
an ArrayBuffer.
Additionally, compared v2.0.5, this avoids an unnecessary copy
when sending data in a request body.
Unforunately some browsers use a version of Buffer
that isn't based on a Uint8Array. Add logic to convert
when necessary but not make copies when unnecessary.