question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refused to set unsafe header "Origin"

See original GitHub issue

Hi, iam trieing to modify my header but if i do so i get: vue-resource.min.js:7 Refused to set unsafe header "Origin"

I have a cross domain origin api access. So i need to modify the header.

Any idea how to do this?

The code:

...
getStationInfos: function(stationInfoURL) {
            try {
                var options = {
                    xhr: {
                        withCredentials: true
                    },
                    beforeSend: function(request) {
                        console.log(request);
                        request.headers.Origin = "http://www.domain.de";
                    }
                };
                this.$http.get(stationInfoURL, {}, options).then(function(infos) {
                    this.$set('currentAudioStream.infos', infos.data);
                });
            } catch (e) {
                console.log(e);
            }
        },
...

I tried to set the Origin header in the Vue Instnace. Same error…

Thank you

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
kulwindermatharucommented, Dec 7, 2019

Chrome Problem

1reaction
chenxuezhoucommented, Apr 8, 2019

chrome deny

Read more comments on GitHub >

github_iconTop 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 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 >
"Origin" header incorrectly set for cross-site request via service ...
When a cross-site request is made to a site that uses a service worker to fetch the request - the Origin header is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found