Skip to content

Make sure we're handling [] in special way #81

@char0n

Description

@char0n
encoded.replace(/%5B/g, '[').replace(/%5D/g, ']');

Ensuring that [ and ] are not percent-encoded is because these characters are part of the syntax used in IPv6 addresses within URIs. According to the URI standard (RFC 3986), these characters are allowed in the host component of a URI to enclose IPv6 addresses, and encoding them would break the correct representation of such addresses.

For example, an IPv6 address in a URL looks like this: http://[2001:db8::1]/. If [ and ] were percent-encoded, it would result in an incorrect URL: http://%5B2001:db8::1%5D/. Thus, these characters must remain unencoded to ensure valid URLs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions