X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=2aa1de20e00d26f7fe1e0fc64b957351904c0030;hp=ea5507d7be1ef17d86751d9e5056ca113ed64065;hb=a2c6c7b9ce592929b361dbfc88f8f87332b17516;hpb=f0580bff341c3d9a8a62bb8e670ff8772745786f diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ea5507d..2aa1de2 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -52,20 +52,30 @@ has request => ( is => 'rw', default => sub { my $self = shift; - my %p = ( _log => $self->log ); - $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; - $self->request_class->new(\%p); + $self->request_class->new($self->_build_request_constructor_args); }, lazy => 1, ); +sub _build_request_constructor_args { + my $self = shift; + my %p = ( _log => $self->log ); + $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp; + \%p; +} + has response => ( is => 'rw', default => sub { my $self = shift; - $self->response_class->new({ _log => $self->log }); + $self->response_class->new($self->_build_response_constructor_args); }, lazy => 1, ); +sub _build_response_constructor_args { + my $self = shift; + { _log => $self->log }; +} + has namespace => (is => 'rw'); sub depth { scalar @{ shift->stack || [] }; }