From: Stefano Zacchiroli Date: Sun, 11 Nov 2001 14:09:35 +0000 (+0000) Subject: Added "/getempty" method. X-Git-Tag: uwobo_pre_ocaml~6 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=1b19b60c84b1becb403f09c17c99997afe5f81d9;p=helm.git Added "/getempty" method. ---- Syntax: "/getempty". Answer: a minimal valid XML document. Currently, the returned document is as follows: ]> ---- --- diff --git a/helm/http_getter/http_getter.pl.in b/helm/http_getter/http_getter.pl.in index fd88194bf..e1546733e 100755 --- a/helm/http_getter/http_getter.pl.in +++ b/helm/http_getter/http_getter.pl.in @@ -227,24 +227,25 @@ while (my $c = $d->accept) { answer($c,$cont,"text/xml",""); } elsif ($http_method eq 'GET' and $http_path eq "/getdtd") { - my $filename = $inputuri; - $filename = $dtd_dir."/".$filename; - print "DTD: $inputuri ==> ($filename)\n"; - if (stat($filename)) { - print "Using local copy\n"; - open(FD, $filename) or die "Cannot open $filename\n"; - $cont = ""; - while() { - # Vary bad heuristic for substituion of absolute URLs - # for relative ones - s/ENTITY (.*) SYSTEM\s+"/ENTITY $1 SYSTEM "$myownurl\/getdtd?uri=/g; - $cont .= $_; - } - close(FD); - answer($c,$cont,"text/xml",""); - } else { - die "Could not find DTD!"; - } + +# my $filename = $inputuri; +# $filename = $dtd_dir."/".$filename; +# print "DTD: $inputuri ==> ($filename)\n"; +# if (stat($filename)) { +# print "Using local copy\n"; +# open(FD, $filename) or die "Cannot open $filename\n"; +# $cont = ""; +# while() { +# # Vary bad heuristic for substituion of absolute URLs +# # for relative ones +# s/ENTITY (.*) SYSTEM\s+"/ENTITY $1 SYSTEM "$myownurl\/getdtd?uri=/g; +# $cont .= $_; +# } +# close(FD); +# answer($c,$cont,"text/xml",""); +# } else { +# die "Could not find DTD!"; +# } } elsif ($http_method eq 'GET' and $http_path eq "/getstyleconf") { my $filename = $inputuri; @@ -337,6 +338,17 @@ while (my $c = $d->accept) { print "Help requested!\n"; html_nice_answer($c,"HTTP Getter Version: $VERSION"); + } elsif ($http_method eq 'GET' and $http_path eq "/getempty") { + # return an empty, but valid, xml document + my $emptyxml = < + +]> + +EOXML + answer($c, $emptyxml, "", ""); + } elsif ($http_method eq 'GET' and $http_path =~ /\.cgi$/) { # cgi handling print "CGI requested!\n";