Skip to content

Commit

Permalink
Correctly match * as a host-part. (#657)
Browse files Browse the repository at this point in the history
This PR adds support for `*` to the `host-part` matching
algorithm, allowing patterns like `https://*:123` to correctly
match any host.
  • Loading branch information
mikewest committed Apr 24, 2024
1 parent d091bce commit 8fe5fe8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4015,18 +4015,20 @@ this algorithm returns normally if compilation is allowed, and throws a
<ol class="algorithm">
1. If |host| is not a [=domain=], return "`Does Not Match`".

2. If |pattern| <a>starts with</a> "`*.`":
2. If |pattern| is "`*`", return "`Matches`".

3. If |pattern| <a>starts with</a> "`*.`":

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

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

3. Return "`Does Not Match`".

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

4. Return "`Matches`".
5. Return "`Matches`".
</ol>

<h5 id="match-ports" algorithm>
Expand Down

0 comments on commit 8fe5fe8

Please sign in to comment.