-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Should AccessControlAllowOrigin::Value’s value really be a parsed Url? #526
Comments
Well, like all the specs are not as strongly typed as hyper is, so I think this difference is normal and hyper should provide the parsed URL. But is it a real problem, that the URL gets parsed and you compare two URLs and not two strings? Are there cases where this could be a real problem? |
I don’t know how real the problem is, but it’s not the same behavior. URL parsing does some normalization along the way, so comparing parsed URLs is not the same as comparing strings. And CORS is a security/privacy feature, so I’d rather not take chances. |
@Ms2ger, do you have an opinion on this? |
CC @velmont; I assume he's written tests that would fail with parsed URLs, if there's a difference. |
CORS needs to do string comparison. You can probably do something with utf-8 percent-encoding vs punycode to show the difference. |
So, is it only in some cases it should be a |
We could use |
@Ms2ger: Good to see you assume the best of people :P There's some I'm quite sure would fail if you throw them through URL normalization. But there is for sure lots of cases that's not tested as I'm not awesome enough to think of'em. Here's the ones that exist: http://w3c-test.org/cors/origin.htm (Aside: Blink does everything correct except the |
@velmont |
Regardless of whether it's allowed, what should browsers do if they encounter it anyway? |
Well, according to that test, is should be considered illegal. The test expects
|
In https://fetch.spec.whatwg.org/#cors-check , the result of "parsing" a
Access-Control-Allow-Origin
seems to be a string, not an URL. See servo/servo#6020.The text was updated successfully, but these errors were encountered: