Commit

ValdikSS committed 239081d

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

Comments (0)

Files changed (1)

File generate-pac.sh Modified

View file
  • Ignore whitespace
  • Hide word diff
   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];