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

Test different URL encodings for Cors Check in Fetch #9587

Open
nikkisquared opened this issue Feb 9, 2016 · 2 comments
Open

Test different URL encodings for Cors Check in Fetch #9587

nikkisquared opened this issue Feb 9, 2016 · 2 comments

Comments

@nikkisquared
Copy link
Contributor

@nikkisquared nikkisquared commented Feb 9, 2016

As @asajeffrey pointed out[1], specifications and standards for handling URLs are inconsistent, and it'd be great to verify how they are working for Fetch's Cors Check step, which works on and cross-compares different Origins.

Tests for this would go in fetch.rs inside the tests/unit/net folder. The test for making a CORS filtered response would be the basis for the new tests, by changing the Access Control Allow Origin[2] header to the type Value and giving it a URL string. Request's origin needs to be set to the same URL, otherwise the Cors Check will always fail because of the origin mismatch.

There are at least two encodings that should be tested for this: punycode[3], and percent-encoding (with % signs for representing non-ASCII characters).

[1] #9525 (comment)
[2] http://hyper.rs/hyper/hyper/header/enum.AccessControlAllowOrigin.html
[3] https://www.punycoder.com/

@jdm jdm added the A-network label Feb 9, 2016
@nox nox added the A-testing label Apr 8, 2017
@nox
Copy link
Member

@nox nox commented Sep 30, 2017

@SimonSapin Is this something we really need to do? rust-url normalises URLs anyway, right?

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 1, 2017

I don’t fully understand what this issue is about. @nikkisquared @asajeffrey, could you clarify? If it is indeed proposing to implement both of two alternative behaviors because a combination of specs seems ambiguous, that’s probably not the right approach.

FWIW Url::domain gives an ASCII string that can be Punycode-encoded but never percent-encoded.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.