When authenticating against a secured endpoint in cors mode with wrong credentials, the proxy sends a response send_resp(:unauthorized, "Authentication failed.") without cors headers. Because we started the request as a cors request, the request fails with the current implementation for any client that cares about SOP, giving back a network error with no body. For frontend clients like browsers, this means we cant get a meaningful error message.
Adding the cors headers on failed authentication will give us the opportunity to handle them better in frontend since we get a correct http status and a body to read from.
When authenticating against a secured endpoint in cors mode with wrong credentials, the proxy sends a response
send_resp(:unauthorized, "Authentication failed.")
without cors headers. Because we started the request as a cors request, the request fails with the current implementation for any client that cares about SOP, giving back a network error with no body. For frontend clients like browsers, this means we cant get a meaningful error message.Adding the cors headers on failed authentication will give us the opportunity to handle them better in frontend since we get a correct http status and a body to read from.