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

cors: always return 204 for a matched preflight #150

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

gregwebs
Copy link
Contributor

@gregwebs gregwebs commented Oct 27, 2023

Previously it could return a 404, etc.
This had the effect of in the browser producting a network error because the preflight request failed.

These changes are passing the test suite but are not yet manually tested.

Previously it could return a 404, etc.
This had the effect of in the browser producting a network error
because the preflight request failed.
@gregwebs
Copy link
Contributor Author

So this will still end up having the 404 issue because it specifically mounts to existing routes. But it will avoid other issues with a middleware returning a 401, etc.

@raphael
Copy link
Member

raphael commented Oct 27, 2023

Looks great, thank you!

@raphael raphael merged commit 283c213 into goadesign:v3 Oct 27, 2023
1 check passed
@gregwebs
Copy link
Contributor Author

gregwebs commented Nov 1, 2023

I tested this locally and am now seeing 204 instead of 200 and it is working in the browser

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

Successfully merging this pull request may close these issues.

3 participants