From 25f395b5f04950d3198729f33335e6c191038452 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 18 Jul 2012 00:49:54 -0500 Subject: fix compilation --- lib/Web/Request.pm | 52 ++++++++++++++++++++++++++++------------------------ lib/Web/Response.pm | 2 +- 2 files changed, 29 insertions(+), 25 deletions(-) (limited to 'lib') diff --git a/lib/Web/Request.pm b/lib/Web/Request.pm index 8517898..8ba5c69 100644 --- a/lib/Web/Request.pm +++ b/lib/Web/Request.pm @@ -17,22 +17,22 @@ has env => ( confess "Can't get the env if it wasn't provided during construction"; }, handles => { - address => 'REMOTE_ADDR', - remote_host => 'REMOTE_HOST', - protocol => 'SERVER_PROTOCOL', - method => 'REQUEST_METHOD', - port => 'SERVER_PORT', - user => 'REMOTE_USER', - request_uri => 'REQUEST_URI', - path_info => 'PATH_INFO', - script_name => 'SCRIPT_NAME', - scheme => 'psgi.url_scheme', - _input => 'psgi.input', - content_length => 'CONTENT_LENGTH', - content_type => 'CONTENT_TYPE', - session => 'psgix.session', - session_options => 'psgix.session.options', - logger => 'psgix.logger', + address => [ get => 'REMOTE_ADDR' ], + remote_host => [ get => 'REMOTE_HOST' ], + protocol => [ get => 'SERVER_PROTOCOL' ], + method => [ get => 'REQUEST_METHOD' ], + port => [ get => 'SERVER_PORT' ], + user => [ get => 'REMOTE_USER' ], + request_uri => [ get => 'REQUEST_URI' ], + path_info => [ get => 'PATH_INFO' ], + script_name => [ get => 'SCRIPT_NAME' ], + scheme => [ get => 'psgi.url_scheme' ], + _input => [ get => 'psgi.input' ], + content_length => [ get => 'CONTENT_LENGTH' ], + content_type => [ get => 'CONTENT_TYPE' ], + session => [ get => 'psgix.session' ], + session_options => [ get => 'psgix.session.options' ], + logger => [ get => 'psgix.logger' ], }, ); @@ -150,16 +150,16 @@ has _parsed_body => ( my $cl = $self->content_length; if (!$ct && !$cl) { return { - _content => '', - _body => {}, - _uploads => {}, + content => '', + body => {}, + uploads => {}, }; } my $body = HTTP::Body->new($ct, $cl); $body->cleanup(1); - my $fh = $self->input; + my $input = $self->input; if ($self->env->{'psgix.input.buffered'}) { $input->seek(0, 0); @@ -189,12 +189,16 @@ has _parsed_body => ( } return { - _content => $content, - _body => $body->param, - _uploads => $body->upload, + content => $content, + body => $body->param, + uploads => $body->upload, } }, - handles => ['_content', '_body', '_uploads'], + handles => { + _content => [ get => 'content' ], + _body => [ get => 'body' ], + _uploads => [ get => 'uploads' ], + }, ); has content => ( diff --git a/lib/Web/Response.pm b/lib/Web/Response.pm index ce5c013..8f2f24a 100644 --- a/lib/Web/Response.pm +++ b/lib/Web/Response.pm @@ -80,7 +80,7 @@ sub _finalize_cookies { my $cookies = $self->cookies; for my $name (keys %$cookies) { - $headers->push_header( + $self->headers->push_header( 'Set-Cookie' => $self->_bake_cookie($name, $cookies->{name}), ); } -- cgit v1.2.3-54-g00ecf