You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard way, going back to at least the mid-90s, to mark up URLs in text is <url>. This, of course, relies on unescaped > not being allowed in URLs. This is clearly stated, with exactly this rationale, in RFC 1738 section 2.2. The URL standard should have similar provisions.
I don't know what that should mean for URL parsing, but in terms of serialization '>' should always be escaped in URLs, imo.
I just tested browser behavior, and:
Firefox consistently escapes '>' in path, userinfo, query, fragment. '>' in host or port cause parsing failure.
Safari escapes '>' in path, userinfo, query. It allows '>' unchanged in host and fragment. '>' in port causes parsing failure.
Chrome escapes '>' in path, userinfo, query, host. It allows '>' unchanged in fragment. '>' in port causes parsing failure.
Edge escapes '>' in path and host. It allows '>' unchanged in fragment and query. '>' in port causes parsing failure. Presence of userinfo causes parsing failure no matter what.
Testcase used:
<pre><script>
var strs = [
"http://test>test/foo\\bar",
"http://a>b@test/foo\\bar",
"http://test/foo\\bar/#a>b",
"http://test/foo\\bar/?a=c>d",
"http://test:2>3/foo\\bar",
"http://test/foo>bar\\baz",
];
for (var str of strs) {
var a = document.createElement("a");
a.setAttribute("href", str);
var href;
try {
href = a.href;
} catch(e) {
href = "href getter threw";
}
var url;
try {
url = (new URL(str).href);
} catch(e) {
url = "constructor threw";
}
document.writeln(str, " -- ", href, " -- ", url);
}
</script>
with the \\ bits in there a way to tell whether parsing failed in the href case.
The text was updated successfully, but these errors were encountered:
Currently, we percent-encode characters in "fragment state" using the C0
control percent-encode set. Firefox encodes more than that, and it seems
reasonable to align around that behavior for reasons spelled out in #291
and the comments of #344.
This patch adds a new "fragment percent-encode set" which contains the
C0 control percent-encode set, along with:
* 0x20 (SP)
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)
Tests: web-platform-tests/wpt#7776.
Closes#344.
The standard way, going back to at least the mid-90s, to mark up URLs in text is
<url>
. This, of course, relies on unescaped>
not being allowed in URLs. This is clearly stated, with exactly this rationale, in RFC 1738 section 2.2. The URL standard should have similar provisions.I don't know what that should mean for URL parsing, but in terms of serialization '>' should always be escaped in URLs, imo.
I just tested browser behavior, and:
Testcase used:
with the
\\
bits in there a way to tell whether parsing failed in the href case.The text was updated successfully, but these errors were encountered: