From: Claudio Sacerdoti Coen Date: Mon, 5 Feb 2001 16:41:01 +0000 (+0000) Subject: When downloading stylesheets, substitutes all relative URLs with X-Git-Tag: v0_1_2~142 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=71cc512008eddc1c64b0388b7def903d1994eaa2;p=helm.git When downloading stylesheets, substitutes all relative URLs with absolute URLs through a very bad heuristic (regular expression) --- diff --git a/helm/http_getter/http_getter.pl.in b/helm/http_getter/http_getter.pl.in index b1ec80aeb..1c7359b6c 100755 --- a/helm/http_getter/http_getter.pl.in +++ b/helm/http_getter/http_getter.pl.in @@ -62,9 +62,12 @@ use Compress::Zlib; #CSC: altra roba da sistemare segnata con CSC my $d = new HTTP::Daemon LocalPort => 8081; +my $myownurl = $d->url; +$myownurl =~ s/\/$//; # chop the final slash tie(%map, 'DB_File', $uris_dbm.".db", O_RDONLY, 0664); -print "Please contact me at: url, ">\n"; +print "Please contact me at: \n"; print "helm_dir: $helm_dir\n"; +print "styles_dir: $styles_dir\n"; print "dtd_dir: $dtd_dir\n"; print "urls_of_uris.db: $uris_dbm.db\n"; print "cache mode: $cachemode\n"; @@ -234,7 +237,13 @@ EOT print "Using local copy\n"; open(FD, $filename) or die "Cannot open $filename\n"; $cont = ""; - while() { $cont .= $_; } + while() { + # Vary bad heuristic for substituion of absolute URLs + # for relative ones + s/xsl:import\s+href="/xsl:import href="$myownurl\/getxslt?uri=/g ; + s/xsl:include\s+href="/xsl:include href="$myownurl\/getxslt?uri=/g ; + $cont .= $_; + } close(FD); answer($c,$cont); } else {