From a938b1812c54dc720475bc5d9b9cf3215f1b3371 Mon Sep 17 00:00:00 2001 From: des Date: Fri, 13 Jul 2007 11:31:36 +0000 Subject: [PATCH] Strip fragments and query strings. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1689 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-tools/fetcher/fetcher.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); } -- 2.39.5