Hello,
My server's page (
http://abc.com/a) always returns 302 status code
with new location in the response header. New location points to my
server but other subdomain like
http://mac.abc.com/b.
Inside my extension, I need somehow to get only this location. I tried
to use XMLHttpRequest with both 'GET' and 'HEAD' request, but no
success.
In the "Developer Tools"->Resources I see two resources: 'a' and 'b'.
The header of the first one 'a' contain Status Code: 302 Found.
The second one is 200 OK.
I require to be notified after the first response. Instead I am
notified only after the second response.
My code is the following:
var xhr = new XMLHttpRequest();
xhr.open("GET", '
https://www.mysite.com/'); //or HEAD
xhr.onreadystatechange = function() {
console.debug(xhr.status);
console.debug(xhr.getResponseHeader('Location'));
};
xhr.send();
The output: 200 null 200 null 200 null 200 null 200 null.
Is it possible to do?
Thanks,
Valery.