Title: [247267] trunk
Revision
247267
Author
[email protected]
Date
2019-07-09 12:12:42 -0700 (Tue, 09 Jul 2019)

Log Message

URLParser should reserialize IPv6 addresses that end with a colon
https://bugs.webkit.org/show_bug.cgi?id=199627

Reviewed by Brady Eidson.

Source/WTF:

When an IPv6 address ends in a colon, the colon should be removed which means the
serialized output is different than the input, which the URLParser calls a syntax violation.
This matches the URL specification, and I added a unit test that used to assert.

* wtf/URLParser.cpp:
(WTF::URLParser::parseIPv6Host):

Tools:

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

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (247266 => 247267)


--- trunk/Source/WTF/ChangeLog	2019-07-09 18:55:43 UTC (rev 247266)
+++ trunk/Source/WTF/ChangeLog	2019-07-09 19:12:42 UTC (rev 247267)
@@ -1,3 +1,17 @@
+2019-07-09  Alex Christensen  <[email protected]>
+
+        URLParser should reserialize IPv6 addresses that end with a colon
+        https://bugs.webkit.org/show_bug.cgi?id=199627
+
+        Reviewed by Brady Eidson.
+
+        When an IPv6 address ends in a colon, the colon should be removed which means the
+        serialized output is different than the input, which the URLParser calls a syntax violation.
+        This matches the URL specification, and I added a unit test that used to assert.
+
+        * wtf/URLParser.cpp:
+        (WTF::URLParser::parseIPv6Host):
+
 2019-07-08  Chris Dumez  <[email protected]>
 
         Use WeakHashSet for WebUserContentControllerProxy::m_processes

Modified: trunk/Source/WTF/wtf/URLParser.cpp (247266 => 247267)


--- trunk/Source/WTF/wtf/URLParser.cpp	2019-07-09 18:55:43 UTC (rev 247266)
+++ trunk/Source/WTF/wtf/URLParser.cpp	2019-07-09 19:12:42 UTC (rev 247267)
@@ -2467,6 +2467,8 @@
         if (piecePointer == 8 || *c != ':')
             return WTF::nullopt;
         advance(c, hostBegin);
+        if (c.atEnd())
+            syntaxViolation(hostBegin);
 
         immediatelyAfterCompress = false;
     }

Modified: trunk/Tools/ChangeLog (247266 => 247267)


--- trunk/Tools/ChangeLog	2019-07-09 18:55:43 UTC (rev 247266)
+++ trunk/Tools/ChangeLog	2019-07-09 19:12:42 UTC (rev 247267)
@@ -1,3 +1,13 @@
+2019-07-09  Alex Christensen  <[email protected]>
+
+        URLParser should reserialize IPv6 addresses that end with a colon
+        https://bugs.webkit.org/show_bug.cgi?id=199627
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WTF/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2019-07-08  Aakash Jain  <[email protected]>
 
         [ews-build] Do not run unix commands for windows in PrintConfiguration

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp (247266 => 247267)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp	2019-07-09 18:55:43 UTC (rev 247266)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp	2019-07-09 19:12:42 UTC (rev 247267)
@@ -353,6 +353,7 @@
     checkURL("http://[0:f:0:0:f::]:\t123", {"http", "", "", "[0:f:0:0:f::]", 123, "/", "", "", "http://[0:f:0:0:f::]:123/"});
     checkURL("http://[0:f:0:0:f::]:1\t23", {"http", "", "", "[0:f:0:0:f::]", 123, "/", "", "", "http://[0:f:0:0:f::]:123/"});
     checkURL("http://[0:f::f:f:0:0]:/path", {"http", "", "", "[0:f::f:f:0:0]", 0, "/path", "", "", "http://[0:f::f:f:0:0]/path"});
+    checkURL("a://[::2:]", {"a", "", "", "[::2]", 0, "", "", "", "a://[::2]"});
     checkURL("http://[0:f::f:f:0:0]:", {"http", "", "", "[0:f::f:f:0:0]", 0, "/", "", "", "http://[0:f::f:f:0:0]/"});
     checkURL("http://host:10100/path", {"http", "", "", "host", 10100, "/path", "", "", "http://host:10100/path"});
     checkURL("http://host:/path", {"http", "", "", "host", 0, "/path", "", "", "http://host/path"});
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to