From a5b70be1b3b6fa9dcb37e981220e5dc7cb1fdf18 Mon Sep 17 00:00:00 2001 From: Jeremy Roman Date: Wed, 8 Jan 2025 16:43:09 -0500 Subject: [PATCH] Serialize base URL's host when a string is required If the URL's host is an IP address, the string representation is required. This corrects/clarifies existing behavior. --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index ed5e405..532e404 100644 --- a/spec.bs +++ b/spec.bs @@ -1858,7 +1858,7 @@ To convert a modifier to a string given a [=part/modifier=] |modifier 1. If |type| is not "`pattern`" and |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", "{{URLPatternInit/port}}" and "{{URLPatternInit/username}}", then set |result|["{{URLPatternInit/username}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/username=] and |type|. 1. If |type| is not "`pattern`" and |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", "{{URLPatternInit/port}}", "{{URLPatternInit/username}}" and "{{URLPatternInit/password}}", then set |result|["{{URLPatternInit/password}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/password=] and |type|. 1. If |init| [=map/contains=] neither "{{URLPatternInit/protocol}}" nor "{{URLPatternInit/hostname}}", then: - 1. Let |baseHost| be |baseURL|'s [=url/host=]. + 1. Let |baseHost| be the [=host serializer|serialization=] of |baseURL|'s [=url/host=]. 1. If |baseHost| is null, then set |baseHost| to the empty string. 1. Set |result|["{{URLPatternInit/hostname}}"] to the result of [=processing a base URL string=] given |baseHost| and |type|. 1. If |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", and "{{URLPatternInit/port}}", then: