Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status code message not returning when using CORS Anywhere #415

Closed
bengrah-miller opened this issue Mar 2, 2022 · 9 comments
Closed

Status code message not returning when using CORS Anywhere #415

bengrah-miller opened this issue Mar 2, 2022 · 9 comments

Comments

@bengrah-miller
Copy link

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

@hello-smile6
Copy link

You need a different status code.

@hello-smile6
Copy link

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

@bengrah-miller
Copy link
Author

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

@hello-smile6
Copy link

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.

@bengrah-miller
Copy link
Author

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.

@Rob--W
Copy link
Owner

Rob--W commented Mar 28, 2022

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.

@Rob--W Rob--W closed this as completed Mar 28, 2022
@bengrah-miller
Copy link
Author

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.

@Rob--W
Copy link
Owner

Rob--W commented Apr 19, 2022

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.

@bengrah-miller
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants