mirror of
https://bitbucket.org/anticensority/antizapret-pac-generator-light.git
synced 2024-11-22 05:06:04 +03:00
Remove leading www. for domain in the PAC file.
getzones.awk removed leading www since the beginning.
After commit 91b2584
, which changed domain handling logic, this stopped working
correctly for domains beginning with www.
See https://ntc.party/t/pravda-com-ua/670
This commit is contained in:
parent
3f068d7da7
commit
239081d581
@ -70,6 +70,9 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken
|
|||||||
else
|
else
|
||||||
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\");
|
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\");
|
||||||
|
|
||||||
|
// remove leading www
|
||||||
|
shost = shost.replace(/^www\.(.+)/, \"\$1\");
|
||||||
|
|
||||||
var curdomain = shost.match(/(.*)\\.([^.]+\$)/);
|
var curdomain = shost.match(/(.*)\\.([^.]+\$)/);
|
||||||
if (!curdomain || !curdomain[2]) {return \"DIRECT\";}
|
if (!curdomain || !curdomain[2]) {return \"DIRECT\";}
|
||||||
var curhost = curdomain[1];
|
var curhost = curdomain[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user