Skip to content

U+005E (^) in path percent-encode set but only sometimes encoded? #970

@wolfgang42

Description

@wolfgang42

I’m filing this issue here because my best guess is that it’s a bug in Ada somewhere, but I’m quite confused and having trouble interpreting the WhatWG URL spec so maybe this is expected behavior?

URL Ada Firefox Chrome
http://foo/bar^baz http://foo/bar^baz http://foo/bar%5Ebaz http://foo/bar%5Ebaz
http://foo/bar^baz> http://foo/bar%5Ebaz%3E http://foo/bar%5Ebaz%3E http://foo/bar%5Ebaz%3E
quux://foo/bar^baz quux://foo/bar^baz quux://foo/bar^baz quux://foo/bar%5Ebaz
quux://foo/bar^baz> quux://foo/bar%5Ebaz%3E quux://foo/bar^baz%3E quux://foo/bar%5Ebaz%3E

My reading of whatwg/url#607 is that ^ is supposed to be percent-encoded in pathname more or less unconditionally (it seems like Firefox is maybe only doing it for special schemes, but that’s a side point), and frankly #908 seems like it ought to have straightforwardly implemented exactly that.

I haven’t tried to reverse-engineer Ada’s exact behavior, but it seems like caret is only getting encoded if there’s also something else in the URL that needs encoding at the same time, which doesn’t seem right. I guess the WPT tests didn’t catch this because they test all of the percent-encodings at once in a single URL, and so bypass this bug.

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