Don't pass origin as an HTTP header #2250
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1779.
That issue seems to be caused by MetaMask demanding to send the
x-metamask-origin
header, and Ethereum nodes responding with CORS responses that disallow that header. I posted a Wireshark dump in #1779 that illustrates the problem.This is a different fix than #2138. In particular, this fix is compatible with the "Custom RPC" option; in general the extension needs to be able to make requests against arbitrary user-submitted Ethereum nodes, and they can't all be put in the manifest to be exempted from proper CORS checking.
On the other hand, this fix just removes the
x-metamask-origin
header, which presumably was added for a reason. However, since apparently neither Infura nor Parity send CORS responses allowing this header, I don't think it's really tenable to have MetaMask try and send it. If it's really needed for Infura, it should be sent only when Infura is the node provider, until non-Infura nodes can tolerate it.