forwardemail / forwardemail/superagent
Fix "Refused to set unsafe header" in browser by using `message-headers` to omit standard HTTP RFC headers from being set?
Open
- Dominant language
- JavaScript
- Stars
- 16.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I have created a package `message-headers` at that supplies us with standard headers that `superagent` should not modify if we are in `window` (browser) environments. Users experience errors like this https://stackoverflow.com/questions/50364832/refused-to-set-unsafe-header-access-control-request-headers-angular-4/50366340 if they attempt to set standard headers that the browser itself is setting.
Perhaps if one of the `messageHeader.standard` headers is passed, we should omit it (e.g. using a similar approach to Lodash's omit method).
Contributor guide
Assessment
This issue has not been assessed yet.