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
#1,420 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.