mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1848874 - Removed network.dns.limit_253_chars pref. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D186573
This commit is contained in:
parent
cbee8deaf8
commit
757097532f
@ -11762,14 +11762,6 @@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# When this pref is true we enforce a 253 character limit on domains we try to
|
||||
# resolve. See bug 1264117. If it doesn't cause any web-compat issues we can
|
||||
# remove it in a few releases
|
||||
- name: network.dns.limit_253_chars
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# When this pref is true, we copy the host name to a fresh string before
|
||||
# calling into getaddrinfo.
|
||||
- name: network.dns.copy_string_before_call
|
||||
|
@ -872,9 +872,8 @@ void net_ParseRequestContentType(const nsACString& aHeaderStr,
|
||||
}
|
||||
|
||||
bool net_IsValidHostName(const nsACString& host) {
|
||||
// A DNS name is limited to 255 bytes on the wire.
|
||||
// In practice this means the host name is limited to 253 ascii characters.
|
||||
if (StaticPrefs::network_dns_limit_253_chars() && host.Length() > 253) {
|
||||
// The host name is limited to 253 ascii characters.
|
||||
if (host.Length() > 253) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// Tests that domains longer than 253 characters fail to load when pref is true
|
||||
|
||||
add_task(async function test_long_domain_fails() {
|
||||
Services.prefs.setBoolPref("network.dns.limit_253_chars", true);
|
||||
let domain = "http://" + "a".repeat(254);
|
||||
|
||||
let req = await new Promise(resolve => {
|
||||
@ -12,6 +11,4 @@ add_task(async function test_long_domain_fails() {
|
||||
chan.asyncOpen(new ChannelListener(resolve, null, CL_EXPECT_FAILURE));
|
||||
});
|
||||
Assert.equal(req.status, Cr.NS_ERROR_UNKNOWN_HOST, "Request should fail");
|
||||
|
||||
Services.prefs.clearUserPref("network.dns.limit_253_chars");
|
||||
});
|
||||
|
@ -89,8 +89,6 @@ add_task(
|
||||
domain = "a".repeat(254);
|
||||
overrideService.addIPOverride(domain, "1.2.3.4");
|
||||
|
||||
Services.prefs.setBoolPref("network.dns.limit_253_chars", true);
|
||||
|
||||
if (mozinfo.socketprocess_networking) {
|
||||
// When using the socket process, the call fails asynchronously.
|
||||
Services.dns.asyncResolve(
|
||||
@ -121,23 +119,5 @@ add_task(
|
||||
"Should throw for large domains"
|
||||
);
|
||||
}
|
||||
|
||||
listener = new Listener();
|
||||
domain = "a".repeat(254);
|
||||
Services.prefs.setBoolPref("network.dns.limit_253_chars", false);
|
||||
Services.dns.asyncResolve(
|
||||
domain,
|
||||
Ci.nsIDNSService.RESOLVE_TYPE_DEFAULT,
|
||||
Ci.nsIDNSService.RESOLVE_CANONICAL_NAME,
|
||||
null, // resolverInfo
|
||||
listener,
|
||||
mainThread,
|
||||
defaultOriginAttributes
|
||||
);
|
||||
[, , inStatus] = await listener;
|
||||
Assert.equal(inStatus, Cr.NS_OK);
|
||||
|
||||
Services.prefs.clearUserPref("network.dns.limit_253_chars");
|
||||
overrideService.clearOverrides();
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user