Rob--W/cors-anywhere

Status code message not returning when using CORS Anywhere

bengrah-miller opened this issue · 9 comments

Hi there,

We've got an endpoint that if it returns a 500, it will also return an error message:

Status Code: 500 Email address did not match, please get in touch with IT Service Desk for assistance.

I get the above if I make the request directly. If I use CORS Anywhere, the 'Email address did not match...' error doesn't get returned. This is what I get if I use the demo server as an example (e.g. URL is Request URL: https://cors-anywhere.herokuapp.com/https://bengrahURL

Status Code: 500 Internal Server Error

Any ideas why this is?

Thanks,
bengrah

You need a different status code.

500 is for server-side issues. Consider 401 or 403.

Hi @hello-smile6 - 403 and 401 don't apply in this instance, as the issue is something not being returned on the server side.

Hi @hello-smile6 - 403 and 401 don't apply in this instance, as the issue is something not being returned on the server side.

If it's an issue with permissions, send 403.

It's not an issue with permissions - the endpoint is sent an email address, and if we can't find a match we send back a 500.

Without the actual URL it is difficult to tell what's going on. If the API is requested via a website in a browser, the proxy request itself is expected to succeed. Any (erroneous) response is the responsibility of your endpoint.

Hi @Rob--W

Like I said in my original post, if I make the request directly, I get the response Status Code: 500 Email address did not match, please get in touch with IT Service Desk for assistance. which is what I'd expect.

If I make the request via CORS anywhere, I get Status Code: 500 Internal Server Error - I've already configured the appropriate response via the endpoint, but it appears not to be coming through using CORS anywhere.

500 Internal Server Error is not from CORS Anywhere itself either.

Someone recently opened an issue about the same error in #410, where there may be a misconfiguration in nginx.

Hi @Rob--W - we're not using nginx in our setup. I believe it's just Apache Tomcat - is there any debug or anything like that I can put on to try and highlight the source of this issue?