diff options
-rw-r--r-- | lib/Web/Request.pm | 4 | ||||
-rw-r--r-- | lib/Web/Response.pm | 2 |
2 files changed, 4 insertions, 2 deletions
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 => { |