From aa430641f0ed3125b18576f991b14bcad5000591 Mon Sep 17 00:00:00 2001 From: Jeremy Roman Date: Wed, 15 Jan 2025 11:16:18 -0500 Subject: [PATCH] Correct null handling when computing base URL host string --- spec.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index ff04d35..ef3b36e 100644 --- a/spec.bs +++ b/spec.bs @@ -1858,8 +1858,8 @@ 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 the [=host serializer|serialization=] of |baseURL|'s [=url/host=]. - 1. If |baseHost| is null, then set |baseHost| to the empty string. + 1. Let |baseHost| be the empty string. + 1. If |baseURL|'s [=url/host=] is not null, then set |baseHost| to its [=host serializer|serialization=]. 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: 1. If |baseURL|'s [=url/port=] is null, then set |result|["{{URLPatternInit/port}}"] to the empty string.