Commit a762819e authored by Alex Catarineu's avatar Alex Catarineu
Browse files

Bugs 22538 and 22513: fix also for IP address hosts

parent 5e3bc461
......@@ -871,7 +871,14 @@ function torbutton_new_circuit() {
let urlOrigin = new URL(origin);
let { hostname } = new URL(urlOrigin.searchParams.get('u'));
if (hostname) {
firstPartyDomain = Services.eTLD.getBaseDomainFromHost(hostname) || firstPartyDomain;
try {
firstPartyDomain = Services.eTLD.getBaseDomainFromHost(hostname);
} catch (e) {
if (e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS ||
e.result == Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
firstPartyDomain = hostname;
}
}
}
} catch (e) {
torbutton_log(4, "Exception on new circuit" +e);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment