Brrrr Brrrr - 1 year ago 195
Ajax Question

AJAX call following 302 redirect sets origin to null

I'm doing an ajax call From domain A to domain B.

My domain B checks if A is in the list of allowed domains and sets the Access-Control-allow-Origin to domain A. So far, so good.

Domain B responds to the request by sending a 302 redirect to domain C using the Location header.

The ajax call follows the redirect to domain C but has the header: origin null.

I expected the origin header to be set to domain A, after following the redirect.

Can anyone explain to me why the origin is set to null instead of to domain A?


Request from domain A to B

GET / HTTP/1.1

Response from domain B :


Ajax call follows the redirect to domain C:

Origin: null

Answer Source

See here, this seems to suggest its related to a "privacy-sensitive" context.

Are there any browsers that set the origin header to "null" for privacy-sensitive contexts?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download