jorton 2003/03/19 08:41:51
Modified: perl-framework/t/modules autoindex.t
Log:
Fix autoindex tests for mod_autoindex from HEAD, which uses semi-colons
to separate query string parameters rather than ampersands.
Revision Changes Path
1.6 +14 -6 httpd-test/perl-framework/t/modules/autoindex.t
Index: autoindex.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/modules/autoindex.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- autoindex.t 22 Apr 2002 07:21:04 -0000 1.5
+++ autoindex.t 19 Mar 2003 16:41:51 -0000 1.6
@@ -192,15 +192,23 @@
return 0;
}
+ my $sep = '&';
+
+ if ($have_apache_2 && $actual =~ /\?C=.\;/) {
+ ## cope with new 2.1-style headers which use a semi-colon
+ ## to separate query segment parameters
+ $sep = ';';
+ }
+
## set up html for fancy indexing ##
if ($FancyIndexing) {
my $name_href;
my $date_href;
my $size_href;
if ($have_apache_2) {
- $name_href = 'C=N&O=A';
- $date_href = 'C=M&O=A';
- $size_href = 'C=S&O=A';
+ $name_href = 'C=N'.$sep.'O=A';
+ $date_href = 'C=M'.$sep.'O=A';
+ $size_href = 'C=S'.$sep.'O=A';
} else {
$name_href = 'N=A';
$date_href = 'M=A';
@@ -210,8 +218,8 @@
if ($have_apache_2) {
if ($_ =~ /^C=$c/i) {
#print "changed ->$_<- to ";
- $_ = "C=$c\&O=A" if $o =~ /^D$/i;
- $_ = "C=$c\&O=D" if $o =~ /^A$/i;
+ $_ = "C=$c$sep"."O=A" if $o =~ /^D$/i;
+ $_ = "C=$c$sep"."O=D" if $o =~ /^A$/i;
last;
}
} else {
@@ -226,7 +234,7 @@
if ($have_apache_2) {
$html_head .=
- "<pre> <a href=\"?$name_href\">Name</a> <a
href=\"?$date_href\">Last modified</a> <a href=\"?$size_href\">Size</a>
<a href=\"?C=D\&O=A\">Description</a><hr /> <a
href=\"/modules/autoindex/\">Parent Directory</a> -
\n";
+ "<pre> <a href=\"?$name_href\">Name</a> <a
href=\"?$date_href\">Last modified</a> <a href=\"?$size_href\">Size</a>
<a href=\"?C=D$sep"."O=A\">Description</a><hr /> <a
href=\"/modules/autoindex/\">Parent Directory</a> -
\n";
$html_foot = "<hr /></pre>\n</body></html>\n";