X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FCGI.pm;h=ae5a65283f069c0e5ab9a8e7d25c2009d4865ef7;hp=75b8fba0a6b97717a416fcd80521cbd36247e7ef;hb=ac5c933bdd463558e8d621507a53a7b247a9093e;hpb=7fa2c9c1b85c98786655ad5169708d8dc84e8353 diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index 75b8fba..ae5a652 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -41,7 +41,7 @@ sub finalize_headers { $c->response->header( Status => $c->response->status ); - $self->{_header_buf} + $self->{_header_buf} = $c->response->headers->as_string("\015\012") . "\015\012"; } @@ -139,21 +139,21 @@ sub prepare_path { # set the request URI my $path = $base_path . ( $ENV{PATH_INFO} || '' ); $path =~ s{^/+}{}; - + # Using URI directly is way too slow, so we construct the URLs manually my $uri_class = "URI::$scheme"; - + # HTTP_HOST will include the port even if it's 80/443 $host =~ s/:(?:80|443)$//; - + if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) { $host .= ":$port"; } - + # Escape the path $path =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go; $path =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE - + my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : ''; my $uri = $scheme . '://' . $host . '/' . $path . $query; @@ -162,7 +162,7 @@ sub prepare_path { # set the base URI # base must end in a slash $base_path .= '/' unless $base_path =~ m{/$}; - + my $base_uri = $scheme . '://' . $host . $base_path; $c->request->base( bless \$base_uri, $uri_class );