mirror of
https://bitbucket.org/anticensority/antizapret-pac-generator-light.git
synced 2025-02-16 14:33:14 +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
|
||||
shost = host.replace(/(.+)\.([^.]+\.[^.]+$)/, \"\$2\");
|
||||
|
||||
// remove leading www
|
||||
shost = shost.replace(/^www\.(.+)/, \"\$1\");
|
||||
|
||||
var curdomain = shost.match(/(.*)\\.([^.]+\$)/);
|
||||
if (!curdomain || !curdomain[2]) {return \"DIRECT\";}
|
||||
var curhost = curdomain[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user