X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FCGI%2FMaypole.pm;h=88abc3cebf7218ed1f8c419937834ca04c96d5bd;hb=271fd90b8a1b9f843853601a75a1334407ff87c4;hp=39514f97cb763550eb03f46451fcaaaeb36a4597;hpb=c335fbb1eaabf2ada28ce78f69299a96b33f3759;p=maypole.git diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index 39514f9..88abc3c 100644 --- a/lib/CGI/Maypole.pm +++ b/lib/CGI/Maypole.pm @@ -3,6 +3,7 @@ use base 'Maypole'; use strict; use warnings; +use CGI::Simple; our $VERSION = '2.05'; @@ -12,7 +13,6 @@ sub run { } sub get_request { - require CGI::Simple; shift->{cgi} = CGI::Simple->new(); } @@ -40,10 +40,15 @@ sub parse_args { sub send_output { my $r = shift; + my %processed = map { "-".$_,$r->{extra_headers}{$_} } + keys %{$r->{extra_headers}}; print $r->{cgi}->header( -type => $r->{content_type}, -charset => $r->{document_encoding}, -content_length => do { use bytes; length $r->{output} }, + %processed + ? %processed + : {} ); print $r->{output}; }