From 4310a8e3c45dcad070981eb572ccfcb877f8233f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 19 Aug 2012 10:40:23 -0500 Subject: can't just pass this in the constructor if people use the arrayref form --- lib/Web/Request.pm | 4 +++- lib/Web/Response.pm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Web/Request.pm b/lib/Web/Request.pm index 3830344..f889f62 100644 --- a/lib/Web/Request.pm +++ b/lib/Web/Request.pm @@ -421,7 +421,9 @@ sub new_response { my $self = shift; Class::Load::load_class($self->response_class); - $self->response_class->new(_encoding_obj => $self->_encoding_obj, @_); + my $res = $self->response_class->new(@_); + $res->_encoding_obj($self->_encoding_obj); + return $res; } sub _new_upload { diff --git a/lib/Web/Response.pm b/lib/Web/Response.pm index 7ab39db..914cbbd 100644 --- a/lib/Web/Response.pm +++ b/lib/Web/Response.pm @@ -71,7 +71,7 @@ has cookies => ( ); has _encoding_obj => ( - is => 'ro', + is => 'rw', isa => 'Object', predicate => 'has_encoding', handles => { -- cgit v1.2.3-54-g00ecf