mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Fixes for 79057 submitted by tingley@sundell.net, r=bbaetz, sr=darin, a=asa@mozilla.org
This commit is contained in:
parent
78858a026b
commit
ce553ea222
@ -115,6 +115,7 @@ nsProxyAutoConfig.prototype = {
|
||||
// see bugs 80363 and 92516.
|
||||
ProxySandBox.myIP = "127.0.0.1";
|
||||
}
|
||||
ProxySandBox.dnsResolve = dnsResolve;
|
||||
LocalFindProxyForURL=ProxySandBox.FindProxyForURL;
|
||||
},
|
||||
|
||||
@ -124,6 +125,16 @@ nsProxyAutoConfig.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
// wrapper for dns.resolve to catch exception on failure
|
||||
function dnsResolve(host) {
|
||||
try {
|
||||
var ip = dns.resolve(host);
|
||||
return ip;
|
||||
}
|
||||
catch (e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
var pacModule = new Object();
|
||||
|
||||
pacModule.registerSelf =
|
||||
@ -198,6 +209,8 @@ var pacUtils =
|
||||
" var test = /^(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})\\.(\\d{1,4})$/(ipaddr);\n"+
|
||||
" if (test == null) {\n"+
|
||||
" ipaddr = dnsResolve(ipaddr);\n"+
|
||||
" if (ipaddr == null)\n"+
|
||||
" return false;\n"+
|
||||
" } else if (test[1] > 255 || test[2] > 255 || \n"+
|
||||
" test[3] > 255 || test[4] > 255) {\n"+
|
||||
" return false; // not an IP address\n"+
|
||||
|
Loading…
Reference in New Issue
Block a user