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

Detect 503 status code if rejected by CORS #426

Closed
NeXTs opened this issue Nov 8, 2016 · 1 comment
Closed

Detect 503 status code if rejected by CORS #426

NeXTs opened this issue Nov 8, 2016 · 1 comment

Comments

@NeXTs
Copy link

NeXTs commented Nov 8, 2016

Is it possible to detect response status code if request was rejected by CORS?

Let's say for testing purposes my server side which is located on different domain is hardcoded to return 503 status code. Because of that - all requests rejects and catched by .catch(error => {}) but error argument is just rejecting message (TypeError: Failed to fetch), it does not contain status code and I can not find a way to detect it.

Is it possible at all?

@dgraham
Copy link
Contributor

dgraham commented Nov 8, 2016

I don't think this is possible because a 503 error will be sent in response to the OPTIONS pre-flight request, which is considered part of the connection setup and unavailable to fetch or XMLHttpRequest.

@dgraham dgraham closed this as completed Nov 8, 2016
@NeXTs NeXTs mentioned this issue Dec 23, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants