Skip to content

Commit 8fe5fe8

Browse files
authored
Correctly match * as a host-part. (#657)
This PR adds support for `*` to the `host-part` matching algorithm, allowing patterns like `https://*:123` to correctly match any host.
1 parent d091bce commit 8fe5fe8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.bs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4015,18 +4015,20 @@ this algorithm returns normally if compilation is allowed, and throws a
40154015
<ol class="algorithm">
40164016
1. If |host| is not a [=domain=], return "`Does Not Match`".
40174017

4018-
2. If |pattern| <a>starts with</a> "`*.`":
4018+
2. If |pattern| is "`*`", return "`Matches`".
4019+
4020+
3. If |pattern| <a>starts with</a> "`*.`":
40194021

40204022
1. Let |remaining| be |pattern| with the leading U+002A (`*`) removed and <a>ASCII lowercased</a>.
40214023

40224024
2. If |host| to <a>ASCII lowercase</a> <a>ends with</a> |remaining|, then return "`Matches`".
40234025

40244026
3. Return "`Does Not Match`".
40254027

4026-
3. If |pattern| is not an <a>ASCII case-insensitive</a> match for |host|, return
4028+
4. If |pattern| is not an <a>ASCII case-insensitive</a> match for |host|, return
40274029
"`Does Not Match`".
40284030

4029-
4. Return "`Matches`".
4031+
5. Return "`Matches`".
40304032
</ol>
40314033

40324034
<h5 id="match-ports" algorithm>

0 commit comments

Comments
 (0)