-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
It bothers me I can't set origin when connecting with frame.
More precisely, I can set it but it's ignored by eth-provider:
eth-provider/connections/http.js
Lines 114 to 115 in 99c3c98
| // Below not working becasue XHR lib blocks it claiming "restricted header" | |
| // if (this.options.origin) xhr.setRequestHeader('Origin', this.options.origin) |
Now, I know in a browser environment sets this for a correct value and a user can't do that programmaticaly.
But in node environments (like a cli tool) we can and should set this up to have clarity which program requests a connection.
Therefore, we should:
try {
if (this.options.origin) xhr.setRequestHeader('Origin', this.options.origin)
} catch {
// browser environment will set this to the correct value
}@floating I can create a PR if you want?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels