jhiesey / stream-http

Streaming node http in the browser
MIT License
354 stars 62 forks source link

Allow setting User-Agent Header #89

Closed billiegoose closed 6 years ago

billiegoose commented 6 years ago

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 (edit: and Safari) 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.

fixes: #90

jhiesey commented 6 years ago

Will release after ci tests pass

jhiesey commented 6 years ago

Released as v2.8.3. Thanks for the PR!