From b91bc53de6872ec4b22779382f6955b3af7c6fd5 Mon Sep 17 00:00:00 2001 From: Marcus Ramberg Date: Thu, 9 Dec 2004 07:20:26 +0000 Subject: [PATCH] misc fixes for header support (see list) git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@309 48953598-375a-da11-a14b-00016c27c3ee --- lib/Apache/MVC.pm | 4 ++-- lib/CGI/Maypole.pm | 2 +- lib/Maypole.pm | 1 + lib/Maypole/Headers.pm | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) 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); -- 2.39.5