-
-
Notifications
You must be signed in to change notification settings - Fork 115
Description
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.