What is the issue with the URL Pattern Standard?
The "canonicalize a port" algorithm (link) performs "basic URL parser" for https://dummy.invalid/ after its port is replaced by the input string, and therefore, the output becomes the empty string if the input is "443", the HTTPS default port, by the step 2.1.3 of "basic URL parser"'s "port state" (link).
This algorithm runs in the middle of the "parse a pattern string" algorithm (link) for substrings of port pattern. As a result, some patterns compile to non-intuitive patterns. For example, new URLPattern({ port: "*443" }) results in the same pattern with new URLPattern({ port: "*" }).
What is the issue with the URL Pattern Standard?
The "canonicalize a port" algorithm (link) performs "basic URL parser" for
https://dummy.invalid/after its port is replaced by the input string, and therefore, the output becomes the empty string if the input is "443", the HTTPS default port, by the step 2.1.3 of "basic URL parser"'s "port state" (link).This algorithm runs in the middle of the "parse a pattern string" algorithm (link) for substrings of port pattern. As a result, some patterns compile to non-intuitive patterns. For example,
new URLPattern({ port: "*443" })results in the same pattern withnew URLPattern({ port: "*" }).