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

Add CORS headers to non-preflight OPTIONS too #85

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Conversation

pjediny
Copy link
Contributor

@pjediny pjediny commented Jul 8, 2019

Non preflight OPTIONS requests should work with CORS too.
This change is removing abort in actual request CORS handler for
OPTIONS request, so the client can receive the necessary headers
on such request.

@rs
Copy link
Owner

rs commented Jul 8, 2019

We should probably just not execute the handler on OPTIONS requests with no Access-Control-Request-Method instead.

@pjediny
Copy link
Contributor Author

pjediny commented Jul 8, 2019

I'm not sure why? OPTIONS is used not only in the preflight requests. Fall through is not usable, because the auth is filtered in preflight by browser and on actual request you do not allow it to work with CORS. I would like it to behave as rest of the HTTP methods and while I'm reading the CORS spec, I cannot find a reason why it should be filtered like this and there are actually examples with allowed methods containing OPTIONS. Maybe I'm just misunderstanding something?

@rs
Copy link
Owner

rs commented Jul 8, 2019

Re-reading the spec, I guess you're right.

@rs
Copy link
Owner

rs commented Jul 8, 2019

Please rebase on master to fix the CI.

Non preflight OPTIONS requests should work with CORS too.
This change is removing abort in actual request CORS handler for
OPTIONS request, so the client can receive the necessary headers
on such request.
@pjediny
Copy link
Contributor Author

pjediny commented Jul 8, 2019

Done

@rs rs merged commit db0fe48 into rs:master Jul 9, 2019
@pjediny
Copy link
Contributor Author

pjediny commented Aug 8, 2019

@rs Is there a possibility to cut a release with this patch included anytime soon?

@rs
Copy link
Owner

rs commented Aug 8, 2019

Done

@pjediny
Copy link
Contributor Author

pjediny commented Aug 8, 2019

It looks like the release was done on old tag (v1.4.0) from may 2018, but the latest is (v1.6.0) and new release should have tag > v1.6.0.

@rs
Copy link
Owner

rs commented Aug 8, 2019

fixed

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.

2 participants