Ticket #11455 (closed bug: cantfix)
Response headers unavailable on CORS ajax request
|Reported by:||daniel.yokomizo@…||Owned by:|
I have a local (i.e. file:) HTML and a localhost server. The server answers to GET requests with some application/json and accepts POST requests with application/json body, returning 200/201 + Location header on success.
The server also always sets Access-Control-Allow-Origin: *
I'm testing the HTML using Chromium, with the flag --allow-file-access-from-files.
All GET requests from the page work as expected. All POST requests from the page reach the server, but after returning the response headers are not available. The location returned is null:
var location = xhr.getResponseHeader("Location");
On the Chromium console the response headers are available. The same problem happens on Firefox. Also on Firebug I can see the response headers.
OTOH if I set up a scheme to serve the same HTML file from the server the headers are available and I can use the Location normally.