Refused to set unsafe header “Origin” when using xmlHttpRequest of Google Chrome

This is just a guess, as I use jquery for ajax requests, including CORS.

I think the browser is supposed to set the header, not you. If you were able to set the header, that would defeat the purpose of the security feature.

Try the request without setting those headers and see if the browser sets them for you.

Leave a Comment