Šime Vidas
Šime Vidas

Reputation: 186113

Why does jQuery include an Origin header in my Ajax-requests and how to remove it from them?

For instance, an Ajax request:

$.post( 'http://example.com/script.pl', formdata, function ( data ) {
    // ...
});

But this request also includes an "Origin" header - even though it is not a cross-domain request.

Why is this header included in my Ajax-requests and how can I remove it from them?

Upvotes: 1

Views: 4185

Answers (1)

monsur
monsur

Reputation: 47997

If you are in Chrome (and WebKit?), the "Origin" header is always included on POST, PUT and DELETE requests. This is true for both same-domain and cross-domain requests. The "Origin" header is not included on same-domain GET requests. AFIAK, there is no way to remove this.

Upvotes: 3

Related Questions