matts 2003/02/17 02:47:00
Modified: lib/Apache/AxKit/Provider File.pm
Log:
Really fix provider directory handling
Revision Changes Path
1.14 +14 -2 xml-axkit/lib/Apache/AxKit/Provider/File.pm
Index: File.pm
===================================================================
RCS file: /home/cvs/xml-axkit/lib/Apache/AxKit/Provider/File.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- File.pm 17 Feb 2003 10:31:41 -0000 1.13
+++ File.pm 17 Feb 2003 10:47:00 -0000 1.14
@@ -149,6 +149,15 @@
return undef;
}
+sub decline {
+ my $self = shift;
+ if ($self->_is_dir) {
+ $self->{apache}->header_out('Location' => $self->{apache}->uri .
"/");
+ return 302;
+ }
+ return $self->SUPER::decline();
+}
+
sub process {
my $self = shift;
@@ -162,7 +171,10 @@
if ( $self->_is_dir ) {
# process directories if AxHandleDirs is On and dir ends in /
# (otherwise we decline and let apache redirect)
- if ($AxKit::Cfg->HandleDirs() && $xmlfile =~ /\/$/) {
+ if ($AxKit::Cfg->HandleDirs()) {
+ if ($self->{apache}->uri !~ /\/$/) {
+ return 0;
+ }
my $output = $self->get_dir_xml();
return 0 if (!defined $output);
$self->{dir_xml} = $output;