Refused to set unsafe header "origin"
See original GitHub issueI’m trying to use a CORS proxy to access BitMEX. https://crossorigin.me is down (I see the Cloudflare page), so I tried the Node proxy. I’ve verified that http://localhost:4080/https://www.bitmex.com/api/v1/instrument/activeAndIndices returns correct data in the browser.
The problems is that when I try const markets = await bitmex.load_markets();
in the browser, I get this error:
Refused to set unsafe header “origin” (anonymous) @ fetch-browser.js:470 fetch-browser.js:473 GET http://localhost:4080/https://www.bitmex.com/api/v1/instrument/activeAndIndices 403 (Forbidden)
I get the same error with another proxy, https://cors-anywhere.herokuapp.com/:
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Refused to set unsafe header "Origin" when using ...
I tried removing the receiveReq.setRequestHeader("Origin", ...) call but then Google Chrome throws an access error on my receiveReq.open() call.
Read more >How to fix Refused to set unsafe header Origin while making ...
Refused to set unsafe header Origin error message when you send requests across domains. For this, we need to set up the Access-Control-Allow- ......
Read more >Refused to set unsafe header "Origin" · Issue #257 - GitHub
I solved it by setting the right header on the source. I.E your api server. ChacesY notifications@github.com schrieb am So., 10. Apr. 2016...
Read more >Refused to get unsafe header - TrackJS
The message describes a failed attempt to access header data from a network request. We discovered this error while working on a prototype...
Read more >set-dangerous-headers-local-expected.txt - Google Git
Test that setRequestHeader cannot be used to alter security-sensitive headers for file:// urls. SUCCESS. Powered by Gitiles| Privacy ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kroitor This problem appear again. version v1.14.209. I am sure when using v1.14.180, it have not such a problem. I am always using a proxy. refer to issue #3171
Not really, the point is that in the browser you can’t set the Origin header at all. Bitmex does not support CORS at all. This is the reason for using the CORS proxy in the first place – we need to set some headers, but we can’t do it in the browser (forbidden by the browser security settings), therefore we have to set those headers on the proxy.
With proper HTTPS tunneling via a CORS-proxy, it should work, like it does for most exchanges, however, it doesn’t work for BitMEX for some reason. I will investigate further and will get back to you on this.