Welcome! Log In Create A New Profile

Advanced

Re: CORS headers not being set for a 401 response from upstream.

August 21, 2015 01:30PM
To quote previous email from Maxim:

"In javascript, the code should test the "status" property of the XMLHttpRequest object to find out if the request was successful or not"

The problem here is that xhr.status === 0 if you don't have CORS headers present. If nginx doesn't allow you to add_headers for a 401, a 504, a 404 etc then a Javascript app can't react to each response individually.

Isn't it a little rudimentary to expect a Javascript app to treat to all server errors in the same way? Simply because 401 !== 504.
Subject Author Posted

CORS headers not being set for a 401 response from upstream.

Srirang Doddihal June 09, 2014 07:06AM

Re: CORS headers not being set for a 401 response from upstream.

Maxim Dounin June 10, 2014 07:34AM

Re: CORS headers not being set for a 401 response from upstream.

ensing July 15, 2014 01:37PM

Re: CORS headers not being set for a 401 response from upstream.

Maxim Dounin July 15, 2014 06:22PM

Re: CORS headers not being set for a 401 response from upstream.

manimalcruelty August 21, 2015 01:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 233
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready