Skip to content

Commit

Permalink
Backed out changeset 25f376fb859f (bug 1873973) for causing various r…
Browse files Browse the repository at this point in the history
…egressions.

CLOSED TREE
  • Loading branch information
rvandermeulen committed May 31, 2024
1 parent 6ea5420 commit b5c7b70
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion caps/tests/unit/test_uri_escaping.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ function run_test() {

Assert.equal(
createPrincipal("http://test/foo^bar").exposableSpec,
"http://test/foo^bar"
"http://test/foo%5Ebar"
);
}
19 changes: 0 additions & 19 deletions netwerk/test/unit/test_standardurl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
7 changes: 7 additions & 0 deletions testing/web-platform/meta/url/a-element-xhtml.xhtml.ini
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,9 @@
[Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL

[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
Expand Down Expand Up @@ -974,4 +977,8 @@
[Parsing: <wss://!"$&'()*+,-.;=_`{}~/> against <about:blank>]
expected: FAIL
[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[a-element-xhtml.xhtml?include=mailto]
7 changes: 7 additions & 0 deletions testing/web-platform/meta/url/a-element.html.ini
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@
[Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL

[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
Expand Down Expand Up @@ -1003,4 +1006,8 @@
[Parsing: <wss://!"$&'()*+,-.;=_`{}~/> against <about:blank>]
expected: FAIL
[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[a-element.html?include=mailto]
13 changes: 13 additions & 0 deletions testing/web-platform/meta/url/url-constructor.any.js.ini
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@
[Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL

[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
Expand Down Expand Up @@ -992,6 +995,9 @@
[Parsing: <foo://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL
[Parsing: <foo://host/dir/? !"$%&'()*+,-./:;<=>?@[\\\]^_`{|}~> against <about:blank>]
expected: FAIL

Expand Down Expand Up @@ -1200,6 +1206,9 @@
[Parsing: <wss://!"$&'()*+,-.;=_`{}~/> without base]
expected: FAIL
[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> without base]
expected: FAIL
[url-constructor.any.html?include=file]
[Parsing: <file:c:\\foo\\bar.html> against <file:///tmp/mock/path>]
Expand Down Expand Up @@ -1527,6 +1536,10 @@
[Parsing: <wss://!"$&'()*+,-.;=_`{}~/> without base]
expected: FAIL
[Parsing: <wss://host/ !"$%&'()*+,-./:;<=>@[\\\]^_`{|}~> without base]
expected: FAIL
[url-constructor.any.html?include=javascript]
[Parsing: <javascript:/../> without base]
expected: FAIL
Expand Down
6 changes: 3 additions & 3 deletions xpcom/io/nsEscape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ static constexpr std::array<uint32_t, 256> 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);
Expand Down

0 comments on commit b5c7b70

Please sign in to comment.