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

Allow setting User-Agent Header #89

Merged
merged 1 commit into from
Jun 2, 2018
Merged

Allow setting User-Agent Header #89

merged 1 commit into from
Jun 2, 2018

Conversation

billiegoose
Copy link
Contributor

@billiegoose billiegoose commented Jun 1, 2018

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

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.
@jhiesey jhiesey merged commit 05dd964 into jhiesey:master Jun 2, 2018
@jhiesey
Copy link
Owner

jhiesey commented Jun 2, 2018

Will release after ci tests pass

@jhiesey
Copy link
Owner

jhiesey commented Jun 2, 2018

Released as v2.8.3. Thanks for the PR!

@billiegoose billiegoose deleted the patch-1 branch June 2, 2018 03:59
@jhiesey jhiesey mentioned this pull request Jun 28, 2018
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

Successfully merging this pull request may close these issues.

Unable to set User-Agent
4 participants