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

Non preflight requests from unknown origins should not be rejected #3

Open
ghost opened this issue Jun 8, 2016 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Jun 8, 2016

in https://github.com/lomigmegard/akka-http-cors/blob/master/akka-http-cors/src/main/scala/ch/megard/akka/http/cors/CorsDirectives.scala#L126

Non preflight request is being rejected because it came from an unknown origin

correct behaviour: Non preflight requests from unknown origins should not be rejected

@lomigmegard
Copy link
Owner

Hi @ahmedhamdy88 ,

This is an interesting point you made. I read again the W3C specs, regarding the origin (for both actual and pre-flight requests):

If the value of the Origin header is not a case-sensitive match for any of the values in list of origins do not set any additional headers and terminate this set of steps. §6.1.2 and §6.2.2

I am not sure how to interpret this sentence? Should we stop the complete request handling or just the "cors part"?

I looked at other implementations and it seems these projects are also rejecting the request:

  1. The Cors filter from Dzhuvinov Software rejects the request with a 403 Forbidden.
  2. The Cors filter from eBay rejects the request with a 403 Forbidden as shown in the CORS Flow Chart.
  3. The Mozilla Server-Side Access Control documentation has examples showing requests being rejected with a 403 Forbidden.

Do you have any other sources showing the opposite behaviour? Especially in the case of actual request, for which it is very unclear.

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

No branches or pull requests

1 participant