Title: [206475] trunk
Revision
206475
Author
achristen...@apple.com
Date
2016-09-27 17:25:51 -0700 (Tue, 27 Sep 2016)

Log Message

URLs with @ in the user should only search for the last @ until the end of the authority and host
https://bugs.webkit.org/show_bug.cgi?id=162635

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206474 => 206475)


--- trunk/Source/WebCore/ChangeLog	2016-09-28 00:19:57 UTC (rev 206474)
+++ trunk/Source/WebCore/ChangeLog	2016-09-28 00:25:51 UTC (rev 206475)
@@ -1,3 +1,15 @@
+2016-09-27  Alex Christensen  <achristen...@webkit.org>
+
+        URLs with @ in the user should only search for the last @ until the end of the authority and host
+        https://bugs.webkit.org/show_bug.cgi?id=162635
+
+        Reviewed by Geoffrey Garen.
+
+        Covered by new API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parse):
+
 2016-09-27  Chris Dumez  <cdu...@apple.com>
 
         It should be possible to dispatch events on documents created using DOMParser

Modified: trunk/Source/WebCore/platform/URLParser.cpp (206474 => 206475)


--- trunk/Source/WebCore/platform/URLParser.cpp	2016-09-28 00:19:57 UTC (rev 206474)
+++ trunk/Source/WebCore/platform/URLParser.cpp	2016-09-28 00:25:51 UTC (rev 206475)
@@ -1307,6 +1307,9 @@
                     while (!findLastAt.atEnd()) {
                         if (*findLastAt == '@')
                             lastAt = findLastAt;
+                        bool isSlash = *findLastAt == '/' || (m_urlIsSpecial && *findLastAt == '\\');
+                        if (isSlash || *findLastAt == '?' || *findLastAt == '#')
+                            break;
                         ++findLastAt;
                     }
                     parseAuthority(CodePointIterator<CharacterType>(authorityOrHostBegin, lastAt));

Modified: trunk/Tools/ChangeLog (206474 => 206475)


--- trunk/Tools/ChangeLog	2016-09-28 00:19:57 UTC (rev 206474)
+++ trunk/Tools/ChangeLog	2016-09-28 00:25:51 UTC (rev 206475)
@@ -1,3 +1,13 @@
+2016-09-27  Alex Christensen  <achristen...@webkit.org>
+
+        URLs with @ in the user should only search for the last @ until the end of the authority and host
+        https://bugs.webkit.org/show_bug.cgi?id=162635
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2016-09-27  JF Bastien  <jfbast...@apple.com>
 
         Speed up Heap::isMarkedConcurrently

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206474 => 206475)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-28 00:19:57 UTC (rev 206474)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp	2016-09-28 00:25:51 UTC (rev 206475)
@@ -248,6 +248,7 @@
     checkURL("data:image/png;base64,encoded-data-follows-here", {"data", "", "", "", 0, "image/png;base64,encoded-data-follows-here", "", "", "data:image/png;base64,encoded-data-follows-here"});
     checkURL("data:image/png;base64,encoded/data-with-slash", {"data", "", "", "", 0, "image/png;base64,encoded/data-with-slash", "", "", "data:image/png;base64,encoded/data-with-slash"});
     checkURL("about:~", {"about", "", "", "", 0, "~", "", "", "about:~"});
+    checkURL("https://@test@test@example:800\\path@end", {"", "", "", "", 0, "", "", "", "https://@test@test@example:800\\path@end"});
 
     // This disagrees with the web platform test for http://:@www.example.com but agrees with Chrome and URL::parse,
     // and Firefox fails the web platform test differently. Maybe the web platform test ought to be changed.
@@ -343,6 +344,7 @@
     checkRelativeURL("foo:/", "http://example.org/foo/bar", {"foo", "", "", "", 0, "/", "", "", "foo:/"});
     checkRelativeURL("://:0/", "http://webkit.org/", {"http", "", "", "webkit.org", 0, "/://:0/", "", "", "http://webkit.org/://:0/"});
     checkRelativeURL(String(), "http://webkit.org/", {"http", "", "", "webkit.org", 0, "/", "", "", "http://webkit.org/"});
+    checkRelativeURL("https://@test@test@example:800\\path@end", "http://doesnotmatter/", {"", "", "", "", 0, "", "", "", "https://@test@test@example:800\\path@end"});
 
     // The checking of slashes in SpecialAuthoritySlashes needed to get this to pass contradicts what is in the spec,
     // but it is included in the web platform tests.
@@ -610,6 +612,15 @@
     checkRelativeURLDifferences("https://@test@test@example:800/", "http://doesnotmatter/",
         {"https", "@test@test", "", "example", 800, "/", "", "", "https://%40test%40test@example:800/"},
         {"", "", "", "", 0, "", "", "", "https://@test@test@example:800/"});
+    checkRelativeURLDifferences("https://@test@test@example:800/path@end", "http://doesnotmatter/",
+        {"https", "@test@test", "", "example", 800, "/path@end", "", "", "https://%40test%40test@example:800/path@end"},
+        {"", "", "", "", 0, "", "", "", "https://@test@test@example:800/path@end"});
+    checkURLDifferences("notspecial://@test@test@example:800/path@end",
+        {"notspecial", "@test@test", "", "example", 800, "/path@end", "", "", "notspecial://%40test%40test@example:800/path@end"},
+        {"", "", "", "", 0, "", "", "", "notspecial://@test@test@example:800/path@end"});
+    checkURLDifferences("notspecial://@test@test@example:800\\path@end",
+        {"notspecial", "@test@test@example", "800\\path", "end", 0, "/", "", "", "notspecial://%40test%40test%40example:800%5Cpath@end/"},
+        {"", "", "", "", 0, "", "", "", "notspecial://@test@test@example:800\\path@end"});
     checkRelativeURLDifferences("foo://", "http://example.org/foo/bar",
         {"foo", "", "", "", 0, "/", "", "", "foo:///"},
         {"foo", "", "", "", 0, "//", "", "", "foo://"});
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to