Skip to content

Don't set Header and User-Agent#23

Open
barchard wants to merge 1 commit into
pouchdb:masterfrom
barchard:patch-1
Open

Don't set Header and User-Agent#23
barchard wants to merge 1 commit into
pouchdb:masterfrom
barchard:patch-1

Conversation

@barchard
Copy link
Copy Markdown

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
Copy Markdown
Contributor

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