X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=2a1ed8728f64399da17988528f3cbd2e24e90836;hb=4491e0cc34b2be2fc485ad01fbbf51b61fed4c22;hp=9f97a42859185782ddd51926d48248cc09899b9c;hpb=191665f3c88f4b1f81e4198717077ac08d06bdb7;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 9f97a42..2a1ed87 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -489,8 +489,13 @@ process the query string and extract query parameters. sub prepare_query_parameters { my ($self, $c) = @_; - my $env = $c->request->env; + + if(my $query_obj = $env->{'plack.request.query'}) { + $c->request->query_parameters($query_obj->as_hashref_mixed); + return; + } + my $query_string = exists $env->{QUERY_STRING} ? $env->{QUERY_STRING} : ''; @@ -498,7 +503,11 @@ sub prepare_query_parameters { # Check for keywords (no = signs) # (yes, index() is faster than a regex :)) if ( index( $query_string, '=' ) < 0 ) { - $c->request->query_keywords( $self->unescape_uri($query_string) ); + $c->request->query_keywords($self->unescape_uri($query_string)); + $env->{'plack.request.query'} ||= Hash::MultiValue->new( + map { (URI::Escape::uri_unescape($_), '') } + split(/\+/, $query_string, -1)); + return; } @@ -529,6 +538,8 @@ sub prepare_query_parameters { $query{$param} = $value; } } + + $env->{'plack.request.query'} ||= Hash::MultiValue->from_mixed(\%query); $c->request->query_parameters( \%query ); }