Skip to content

Commit 5e2d3b3

Browse files
riceachromium-wpt-export-bot
authored andcommitted
Support IPv6 literals in KURL::SetHostAndPort
KURL::SetHostAndPort would corrupt IPv6 literals because they contain ":" characters. Make it check for "[]" characters and use the first ":" after an IPv6 address as the start of the port number if one is present. Fixed: 1012416 Change-Id: If07a671b48c8c1b24b16883fb9072a86b0de7ebc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871449 Reviewed-by: Kinuko Yasuda <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Commit-Queue: Adam Rice <[email protected]> Cr-Commit-Position: refs/heads/master@{#710668}
1 parent f2f0130 commit 5e2d3b3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

url/resources/setters_tests.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,17 @@
686686
"port": "2"
687687
}
688688
},
689+
{
690+
"comment": "IPv6 literal address with port, crbug.com/1012416",
691+
"href": "http://example.net",
692+
"new_value": "[2001:db8::2]:4002",
693+
"expected": {
694+
"href": "http://[2001:db8::2]:4002/",
695+
"host": "[2001:db8::2]:4002",
696+
"hostname": "[2001:db8::2]",
697+
"port": "4002"
698+
}
699+
},
689700
{
690701
"comment": "Default port number is removed",
691702
"href": "http://example.net",

0 commit comments

Comments
 (0)