Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Origin evil.com in Request Header

I am trying to send form data to a webservice but below "Request Header" in the "Network" of the Chrome DOM I got the origin evil.example and referer "localhost:8080".

Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate
Accept-Language:nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2
Connection:keep-alive
Content-Length:91
Content-Type:application/x-www-form-urlencoded; charset=UTF-8;
Host:office.insoft.net:9091
Origin:http://evil.example/
Referer:http://localhost:8080/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2230.0 Safari/537.36

I want to change to another origin and "localhost:8080" would be the best origin.

How do I resolve that problem?

like image 829
Øystein Drabløs Avatar asked Dec 04 '14 11:12

Øystein Drabløs


People also ask

Can I change origin in request header?

You cannot change the Origin header the browser sends when your JavaScript asks it to make an HTTP request. (Firefox, at least, will ignore attempts to set it). There isn't any point in changing it anyway.

Can we set origin in request?

In short: you cannot. As described on MDN; Origin is a 'forbidden' header, meaning that you cannot change it programatically. You would need to configure the web server to allow CORS requests.


1 Answers

The overwrite of the header origin is caused by Allow-Control-Allow-Origin: * chrome extension.

Link to the extension

Try disabling this extension in order to solve your problem.

like image 67
Joffrey Maheo Avatar answered Oct 19 '22 10:10

Joffrey Maheo