X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FSimple%2FApplication.pm;h=e3f8f7b4cb56206c6eef52a7dcd74f1fd3f623fb;hb=391190822264aefefa6755d410141688a7155dee;hp=cf2e54a38cd2048a9daa080cb35b10d0e2d0db4c;hpb=d28d24db1b618804d19ee909eb094017f30284b6;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Simple/Application.pm b/lib/Web/Simple/Application.pm index cf2e54a..e3f8f7b 100644 --- a/lib/Web/Simple/Application.pm +++ b/lib/Web/Simple/Application.pm @@ -23,6 +23,17 @@ sub _is_response_filter { and $_[1]->isa('Web::Simple::ResponseFilter'); } +sub _construct_redispatch { + bless(\$_[1], 'Web::Simple::Redispatch'); +} + +sub _is_redispatch { + return unless + "$_[1]" =~ /\w+=[A-Z]/ + and $_[1]->isa('Web::Simple::Redispatch'); + return ${$_[1]}; +} + sub _dispatch_parser { require Web::Simple::DispatchParser; return Web::Simple::DispatchParser->new; @@ -65,6 +76,9 @@ sub _run_dispatch_for { $result, $self->_run_dispatch_for($new_env, \@disp) ); + } elsif (my $path = $self->_is_redispatch($result)) { + $new_env->{PATH_INFO} = $path; + return $self->_run_dispatch_for($new_env, $dispatchables); } return $result; }