From: des Date: Fri, 13 Jul 2007 11:31:36 +0000 (+0000) Subject: Strip fragments and query strings. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a938b1812c54dc720475bc5d9b9cf3215f1b3371;p=varnish Strip fragments and query strings. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1689 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-tools/fetcher/fetcher.pl b/varnish-tools/fetcher/fetcher.pl index 2f951928..3e70828a 100755 --- a/varnish-tools/fetcher/fetcher.pl +++ b/varnish-tools/fetcher/fetcher.pl @@ -75,7 +75,7 @@ sub run($$) { $0 = "[fetcher] checking $url"; if ($resp->header('Content-Type') =~ m/^text\//) { my %urls = map { $_ => 1 } - ($resp->content =~ m/\b(?:href|src)=[\'\"](.+?)[\'\"]/g); + ($resp->content =~ m/\b(?:href|src)=[\'\"]([^\'\"\?\#]+)(?:[\?\#][^\'\"]*)?[\'\"]/g); foreach (keys(%urls)) { $s->write("add $_\n"); }