-
Notifications
You must be signed in to change notification settings - Fork 141
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
Host parsing UTF-8 decoding can fail #215
Comments
https://bugs.webkit.org/show_bug.cgi?id=167330 Source/WebCore: <rdar://problem/29319962> Reviewed by Tim Horton. Covered by new API tests. * platform/URLParser.cpp: (WebCore::containsOnlyASCII): (WebCore::URLParser::parseHostAndPort): If UTF-8 decoding fails after percent-decoding the host, fail to parse. This matches Chrome and Firefox, and it was proposed to the spec in whatwg/url#215 Tools: Reviewed by Tim Horton. * TestWebKitAPI/Tests/WebCore/URLParser.cpp: (TestWebKitAPI::TEST_F): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@211067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Did you add tests on WPT? Also, from what I can tell the patch you uploaded there you are not returning failure since you still manage to extract a scheme, host, patch, etc. from the URL. Or am I misunderstanding the C++ tests? |
I didn't add tests on WPT yet, but the two tests from my patch, "http://example.com%A0" and "http://%E2%98%83", would be great to add. |
Thanks. So we should use https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail instead and propagate the failure. That should be a rather trivial fix. |
(If you could reply to the other URL issues before you go to sleep that would be great, but I can understand if you want to wait until tomorrow.) |
Host parsing step 2 currently reads like this:
"Let domain be the result of UTF-8 decode without BOM on the percent decoding of UTF-8 encode on input."
If the UTF-8 decoding fails, it should explicitly say to return failure. This matches Chrome, Firefox, and WebKit after https://bugs.webkit.org/show_bug.cgi?id=167330
The text was updated successfully, but these errors were encountered: