Backed out 2 changesets (bug 1790287) for causing Bug 1812158 CLOSED TREE

Backed out changeset 4551710b517e (bug 1790287)
Backed out changeset 7295f8ccd81d (bug 1790287)
This commit is contained in:
Narcis Beleuzu 2023-01-25 00:09:39 +02:00
parent 6c240d77ec
commit f97d09d67d
6 changed files with 138 additions and 1228 deletions

View file

@ -326,14 +326,11 @@ NS_IMETHODIMP nsIDNService::IsACE(const nsACString& input, bool* _retval) {
auto stringContains = [](const nsACString& haystack,
const nsACString& needle) {
return std::search(haystack.BeginReading(), haystack.EndReading(),
needle.BeginReading(), needle.EndReading(),
[](unsigned char ch1, unsigned char ch2) {
return tolower(ch1) == tolower(ch2);
}) != haystack.EndReading();
needle.BeginReading(),
needle.EndReading()) != haystack.EndReading();
};
*_retval =
StringBeginsWith(input, "xn--"_ns, nsCaseInsensitiveCStringComparator) ||
*_retval = StringBeginsWith(input, "xn--"_ns) ||
(!input.IsEmpty() && input[0] != '.' &&
stringContains(input, ".xn--"_ns));
return NS_OK;
@ -542,7 +539,7 @@ nsresult nsIDNService::stringPrepAndACE(const nsAString& in, nsACString& out,
if (IsAscii(in)) {
LossyCopyUTF16toASCII(in, out);
// If label begins with xn-- we still want to check its validity
if (!StringBeginsWith(in, u"xn--"_ns, nsCaseInsensitiveStringComparator)) {
if (!StringBeginsWith(in, u"xn--"_ns)) {
return NS_OK;
}
}

View file

@ -1040,8 +1040,4 @@ add_task(function test_jarURI_serialization() {
add_task(async function round_trip_invalid_ace_label() {
let uri = Services.io.newURI("http://xn--xn--d--fg4n-5y45d/");
Assert.equal(uri.spec, "http://xn--xn--d--fg4n-5y45d/");
Assert.throws(() => {
uri = Services.io.newURI("http://a.b.c.XN--pokxncvks");
}, /NS_ERROR_MALFORMED_URI/);
});

View file

@ -1097,6 +1097,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL

View file

@ -1126,6 +1126,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL

File diff suppressed because it is too large Load diff

View file

@ -1257,6 +1257,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL
@ -2001,6 +2033,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL