diff --git a/caps/tests/unit/test_uri_escaping.js b/caps/tests/unit/test_uri_escaping.js index 5b388765fb13e..7feb58129557e 100644 --- a/caps/tests/unit/test_uri_escaping.js +++ b/caps/tests/unit/test_uri_escaping.js @@ -23,6 +23,6 @@ function run_test() { Assert.equal( createPrincipal("http://test/foo^bar").exposableSpec, - "http://test/foo^bar" + "http://test/foo%5Ebar" ); } diff --git a/netwerk/test/unit/test_standardurl.js b/netwerk/test/unit/test_standardurl.js index 8917686130c72..b44289f2e6654 100644 --- a/netwerk/test/unit/test_standardurl.js +++ b/netwerk/test/unit/test_standardurl.js @@ -499,25 +499,6 @@ add_test(function test_hugeStringThrows() { run_next_test(); }); -add_test(function test_caretNotEscaped() { - var url = stringToURL("wss://host/ !\"$%&'()*+,-./:;<=>@[\\]^_{|}~"); - Assert.equal( - url.spec, - "wss://host/%20!%22$%&'()*+,-./:;%3C=%3E@[/]^_%7B|%7D~" - ); - - url = stringToURL("wss://host/abc^.bar"); - Assert.equal(url.spec, "wss://host/abc^.bar"); - - url = stringToURL("wss://host/path/to/something?q=foo^bar"); - Assert.equal(url.spec, "wss://host/path/to/something?q=foo^bar"); - - url = stringToURL("wss://host/#^"); - Assert.equal(url.spec, "wss://host/#^"); - - run_next_test(); -}); - add_test(function test_filterWhitespace() { let url = stringToURL( " \r\n\th\nt\rt\tp://ex\r\n\tample.com/path\r\n\t/\r\n\tto the/fil\r\n\te.e\r\n\txt?que\r\n\try#ha\r\n\tsh \r\n\t " diff --git a/testing/web-platform/meta/url/a-element-xhtml.xhtml.ini b/testing/web-platform/meta/url/a-element-xhtml.xhtml.ini index 85cccd7a88c86..fc4eb05c251e2 100644 --- a/testing/web-platform/meta/url/a-element-xhtml.xhtml.ini +++ b/testing/web-platform/meta/url/a-element-xhtml.xhtml.ini @@ -596,6 +596,9 @@ [Parsing: @[\\\]^_`{|}~> against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + [Parsing: ?@[\\\]^_`{|}~> against ] expected: FAIL @@ -974,4 +977,8 @@ [Parsing: against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + + [a-element-xhtml.xhtml?include=mailto] diff --git a/testing/web-platform/meta/url/a-element.html.ini b/testing/web-platform/meta/url/a-element.html.ini index 33a735bb2be97..6d698e54809ae 100644 --- a/testing/web-platform/meta/url/a-element.html.ini +++ b/testing/web-platform/meta/url/a-element.html.ini @@ -625,6 +625,9 @@ [Parsing: @[\\\]^_`{|}~> against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + [Parsing: ?@[\\\]^_`{|}~> against ] expected: FAIL @@ -1003,4 +1006,8 @@ [Parsing: against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + + [a-element.html?include=mailto] diff --git a/testing/web-platform/meta/url/url-constructor.any.js.ini b/testing/web-platform/meta/url/url-constructor.any.js.ini index 8a4edb79f74f9..25bdaf4be70d5 100644 --- a/testing/web-platform/meta/url/url-constructor.any.js.ini +++ b/testing/web-platform/meta/url/url-constructor.any.js.ini @@ -403,6 +403,9 @@ [Parsing: @[\\\]^_`{|}~> against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + [Parsing: ?@[\\\]^_`{|}~> against ] expected: FAIL @@ -992,6 +995,9 @@ [Parsing: @[\\\]^_`{|}~> against ] expected: FAIL + [Parsing: @[\\\]^_`{|}~> against ] + expected: FAIL + [Parsing: ?@[\\\]^_`{|}~> against ] expected: FAIL @@ -1200,6 +1206,9 @@ [Parsing: without base] expected: FAIL + [Parsing: @[\\\]^_`{|}~> without base] + expected: FAIL + [url-constructor.any.html?include=file] [Parsing: against ] @@ -1527,6 +1536,10 @@ [Parsing: without base] expected: FAIL + [Parsing: @[\\\]^_`{|}~> without base] + expected: FAIL + + [url-constructor.any.html?include=javascript] [Parsing: without base] expected: FAIL diff --git a/xpcom/io/nsEscape.cpp b/xpcom/io/nsEscape.cpp index 353958dc77073..f211ea28096b3 100644 --- a/xpcom/io/nsEscape.cpp +++ b/xpcom/io/nsEscape.cpp @@ -278,9 +278,9 @@ static constexpr std::array BuildEscapeChars() { AddUnescapedChars("'.", esc_Username, table); AddUnescapedChars("'.", esc_Password, table); AddUnescapedChars(".", esc_Host, table); // Same as esc_Scheme - AddUnescapedChars("'./:;=@[]^|", esc_Directory, table); - AddUnescapedChars("'.:;=@[]^|", esc_FileBaseName, table); - AddUnescapedChars("':;=@[]^|", esc_FileExtension, table); + AddUnescapedChars("'./:;=@[]|", esc_Directory, table); + AddUnescapedChars("'.:;=@[]|", esc_FileBaseName, table); + AddUnescapedChars("':;=@[]|", esc_FileExtension, table); AddUnescapedChars(".:;=@[\\]^`{|}", esc_Param, table); AddUnescapedChars("./:;=?@[\\]^`{|}", esc_Query, table); AddUnescapedChars("#'./:;=?@[\\]^{|}", esc_Ref, table);