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

Don't set Header and User-Agent #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

barchard
Copy link

Chrome (in Electron) refuses to set the following headers due to security restrictions:

Refused to set unsafe header "Host"
Refused to set unsafe header "User-Agent"

Chrome (in Electron) refuses to set the following headers due to security restrictions:

```
Refused to set unsafe header "Host"
Refused to set unsafe header "User-Agent"
```
@marten-de-vries
Copy link
Member

Nice catch.

When running in node, the security restrictions are not in place and the headers can be set. Since this module is also used in express-pouchdb quite a bit, it's probably a worthwhile addition to only exclude them when in a browser. This can be done by checking process.browser (at least, for browserify).

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.

2 participants