зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1314859 - SetHost should also call NormalizeIPv4 r=mcmanus
MozReview-Commit-ID: 79sQrld6TBG
This commit is contained in:
Родитель
7508e8b67f
Коммит
627f600a3e
|
@ -1928,6 +1928,12 @@ nsStandardURL::SetHost(const nsACString &input)
|
|||
return rv;
|
||||
}
|
||||
|
||||
nsAutoCString ipString;
|
||||
rv = NormalizeIPv4(hostBuf, ipString);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
hostBuf = ipString;
|
||||
}
|
||||
|
||||
// NormalizeIDN always copies if the call was successful
|
||||
host = hostBuf.get();
|
||||
len = hostBuf.Length();
|
||||
|
|
|
@ -179,9 +179,9 @@ add_test(function test_ipv6()
|
|||
|
||||
url = stringToURL("http://example.com");
|
||||
url.hostPort = "2001:1";
|
||||
do_check_eq(url.host, "2001");
|
||||
do_check_eq(url.host, "0.0.7.209");
|
||||
do_check_eq(url.port, 1);
|
||||
do_check_eq(url.hostPort, "2001:1");
|
||||
do_check_eq(url.hostPort, "0.0.7.209:1");
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
|
|
|
@ -63,9 +63,6 @@
|
|||
[Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
|
||||
expected: FAIL
|
||||
|
||||
[Setting <http://example.net>.host = '0x7F000001:8080' IPv4 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -81,9 +78,6 @@
|
|||
[Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
|
||||
expected: FAIL
|
||||
|
||||
[Setting <http://example.net:8080>.hostname = '0x7F000001' IPv4 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче