mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +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
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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue