r1689 - trunk/varnish-tools/fetcher

des at projects.linpro.no des at projects.linpro.no
Fri Jul 13 13:31:36 CEST 2007


Author: des
Date: 2007-07-13 13:31:36 +0200 (Fri, 13 Jul 2007)
New Revision: 1689

Modified:
   trunk/varnish-tools/fetcher/fetcher.pl
Log:
Strip fragments and query strings.


Modified: trunk/varnish-tools/fetcher/fetcher.pl
===================================================================
--- trunk/varnish-tools/fetcher/fetcher.pl	2007-07-13 08:05:14 UTC (rev 1688)
+++ trunk/varnish-tools/fetcher/fetcher.pl	2007-07-13 11:31:36 UTC (rev 1689)
@@ -75,7 +75,7 @@
 	$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");
 	    }




More information about the varnish-commit mailing list