From: Marcus Ramberg Date: Thu, 9 Dec 2004 07:20:26 +0000 (+0000) Subject: misc fixes for header support (see list) X-Git-Tag: 2.10~55 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=commitdiff_plain;h=b91bc53de6872ec4b22779382f6955b3af7c6fd5 misc fixes for header support (see list) git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@309 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 7dbb241..ba0fec0 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -30,7 +30,7 @@ sub parse_location { my $self = shift; # Reconstruct the request headers - $self->headers_in(HTTP::Headers->new); + $self->headers_in(Maypole::Headers->new); my %headers = $self->{ar}->headers_in; for (keys %headers) { $self->headers_in->set($_, $headers{$_}); @@ -63,7 +63,7 @@ sub send_output { ); foreach ($r->headers_out->field_names) { - next if /^Content-/; + next if /^Content-(Type|Length)/; $r->{ar}->headers_out->set($_ => $r->headers_out->get($_)); } diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index 94fd27b..793d47f 100644 --- a/lib/CGI/Maypole.pm +++ b/lib/CGI/Maypole.pm @@ -59,7 +59,7 @@ sub send_output { -content_length => do { use bytes; length $r->{output} }, ); foreach ($r->headers_out->header_field_names) { - next if /^Content-/; + next if /^Content-(Type|Length)/; $headers{"-$_"} = $r->headers_out->get($_); } diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 3215b84..de7fbeb 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -185,6 +185,7 @@ sub parse_path { shift @pi while @pi and !$pi[0]; $self->{table} = shift @pi; $self->{action} = shift @pi; + $self->{action} = "index" unless $self->{action}; $self->{args} = \@pi; } diff --git a/lib/Maypole/Headers.pm b/lib/Maypole/Headers.pm index a72f01c..16646fa 100644 --- a/lib/Maypole/Headers.pm +++ b/lib/Maypole/Headers.pm @@ -42,7 +42,7 @@ Maypole::Headers - Convenience wrapper around HTTP::Headers use Maypole::Headers; - $r->headers_out(Maypole::Headers->new); + $r->headers_out(Maypole::Headers->new); # Note, automatic in Maypole $r->headers_out->set('Content-Base' => 'http://localhost/maypole'); $r->headers_out->push('Set-Cookie' => $cookie->as_string); $r->headers_out->push('Set-Cookie' => $cookie2->as_string);