mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
AK: Fix missing step step for serialization of IPv6 hosts
This was resulting in the incorrect host serialization of: http://[0:1:0:1:0:1:0:1] to [::1:0:1:0:1:0:1] and: http://[1:0:1:0:1:0:1:0] to [1::1:0:1:0:1:0]
This commit is contained in:
parent
4fdd4dd979
commit
aa7ca80d7c
Notes:
sideshowbarker
2024-07-17 02:37:08 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/aa7ca80d7c Pull-request: https://github.com/SerenityOS/serenity/pull/20278
3 changed files with 25 additions and 1 deletions
|
@ -232,7 +232,6 @@ static void serialize_ipv6_address(URL::IPv6Address const& address, StringBuilde
|
|||
// 1. Let output be the empty string.
|
||||
|
||||
// 2. Let compress be an index to the first IPv6 piece in the first longest sequences of address’s IPv6 pieces that are 0.
|
||||
// 3. If there is no sequence of address’s IPv6 pieces that are 0 that is longer than 1, then set compress to null.
|
||||
Optional<size_t> compress;
|
||||
size_t longest_sequence_length = 0;
|
||||
size_t current_sequence_length = 0;
|
||||
|
@ -250,6 +249,11 @@ static void serialize_ipv6_address(URL::IPv6Address const& address, StringBuilde
|
|||
current_sequence_length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. If there is no sequence of address’s IPv6 pieces that are 0 that is longer than 1, then set compress to null.
|
||||
if (longest_sequence_length <= 1)
|
||||
compress = {};
|
||||
|
||||
// 4. Let ignore0 be false.
|
||||
auto ignore0 = false;
|
||||
|
||||
|
|
|
@ -7,3 +7,21 @@ hostname => 'serenityos.org'
|
|||
port => ''
|
||||
pathname => '/'
|
||||
search => ''
|
||||
http://[0:1:0:1:0:1:0:1]
|
||||
protocol => 'http:'
|
||||
username => ''
|
||||
password => ''
|
||||
host => '[0:1:0:1:0:1:0:1]'
|
||||
hostname => '[0:1:0:1:0:1:0:1]'
|
||||
port => ''
|
||||
pathname => '/'
|
||||
search => ''
|
||||
http://[1:0:1:0:1:0:1:0]
|
||||
protocol => 'http:'
|
||||
username => ''
|
||||
password => ''
|
||||
host => '[1:0:1:0:1:0:1:0]'
|
||||
hostname => '[1:0:1:0:1:0:1:0]'
|
||||
port => ''
|
||||
pathname => '/'
|
||||
search => ''
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
for (url of [
|
||||
'ftp://serenityos.org:21',
|
||||
'http://[0:1:0:1:0:1:0:1]',
|
||||
'http://[1:0:1:0:1:0:1:0]',
|
||||
]) {
|
||||
printURL(url);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue