From: Andy Grundman Date: Mon, 2 Apr 2007 01:41:50 +0000 (+0000) Subject: Revert the c->req->keywords change, this is a feature and should wait until 5.8 X-Git-Tag: 5.7099_04~200 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=94b8f5dec021a418afb9c086b6286f22f18ff1a1 Revert the c->req->keywords change, this is a feature and should wait until 5.8 --- diff --git a/Changes b/Changes index 7856ab0..666c785 100644 --- a/Changes +++ b/Changes @@ -9,8 +9,6 @@ This file documents the revision history for Perl extension Catalyst. * Handle when IE sometimes sends an extra CRLF after the POST body. * Empty fields in multipart/form-data POSTs are no longer ignored. * Uploaded files with the name "0" are no longer ignored. - - Added $c->request->keywords for getting the keywords (a query string with - no parameters). - Sending SIGHUP to the dev server will now cause it to restart. - Allow "0" for a path in uri_for. diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 564cb42..5c8b17f 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -448,9 +448,8 @@ process the query string and extract query parameters. sub prepare_query_parameters { my ( $self, $c, $query_string ) = @_; - # Check for keywords (no = signs) + # Make sure query has params if ( index( $query_string, '=' ) < 0 ) { - $c->request->keywords( $self->unescape_uri($query_string) ); return; } diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 42b3c8a..496682d 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -9,7 +9,7 @@ use utf8; use URI::QueryParam; __PACKAGE__->mk_accessors( - qw/action address arguments cookies headers keywords match method + qw/action address arguments cookies headers match method protocol query_parameters secure captures uri user/ ); @@ -51,7 +51,6 @@ Catalyst::Request - provides information about the current client request $req->headers; $req->hostname; $req->input; - $req->keywords; $req->match; $req->method; $req->param; @@ -260,15 +259,6 @@ sub hostname { Alias for $req->body. -=head2 $req->keywords - -Contains the keywords portion of a query string, when no '=' signs are -present. - - http://localhost/path?some+keywords - - $c->request->keywords will contain 'some keywords' - =head2 $req->match This contains the matching part of a Regex action. Otherwise diff --git a/t/live_engine_request_parameters.t b/t/live_engine_request_parameters.t index 40e517c..b677dc2 100644 --- a/t/live_engine_request_parameters.t +++ b/t/live_engine_request_parameters.t @@ -6,7 +6,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 30; +use Test::More tests => 29; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -103,15 +103,14 @@ use URI; }; my $request = POST( - 'http://localhost/dump/request/a/b?query+string', + 'http://localhost/dump/request/a/b?query_string', 'Content' => $parameters, 'Content-Type' => 'application/x-www-form-urlencoded' ); ok( my $response = request($request), 'Request' ); ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); - is( $creq->{uri}->query, 'query+string', 'Catalyst::Request POST query_string' ); - is( $creq->keywords, 'query string', 'Catalyst::Request keywords' ); + is( $creq->{uri}->query, 'query_string', 'Catalyst::Request POST query_string' ); is_deeply( $creq->{parameters}, $parameters, 'Catalyst::Request parameters' ); ok( $response = request('http://localhost/dump/request/a/b?x=1&y=1&z=1'), 'Request' );