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

Send CORS header with non-200 HTTP statuses too #2735

Open
notramo opened this issue May 8, 2024 · 3 comments
Open

Send CORS header with non-200 HTTP statuses too #2735

notramo opened this issue May 8, 2024 · 3 comments

Comments

@notramo
Copy link

notramo commented May 8, 2024

Describe the Bug

api-gateway.umami.dev does not return an Access-Control-Allow-Origin header.

Database

Umami Cloud

Relevant log output

Umami Cloud

Which Umami version are you using? (if relevant)

Umami Cloud

Which browser are you using? (if relevant)

Firefox

How are you deploying your application? (if relevant)

Umami Cloud

@mikecao
Copy link
Collaborator

mikecao commented May 8, 2024

How are you sending your request? The header is there.

image

@hisune
Copy link

hisune commented May 9, 2024

I feel the same. It seems that it's not because of CORS; it’s due to the API data HTTP response error 500.

image

image

@notramo
Copy link
Author

notramo commented May 10, 2024

Turns out, it was incorrectly configured, and HTTP 400 was returned, but since it does not have CORS headers, Firefox devtools indicated the CORS errors in a way that it was grabbing attention more than the 400 error.

I would still recommend sending CORS headers with HTTP errors, to not confuse CORS error with the real error.

@notramo notramo changed the title CORS error causes 0 visitors recorded Send CORS header with non-200 HTTP statuses too May 10, 2024
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