Skip to content

Encoding for port removes "443" in substrings of patterns #285

@azaika

Description

@azaika

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: "*" }).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions