Skip to content

Commit

Permalink
fixed multi query param support
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 6, 2008
1 parent fcdc29b commit 5483c22
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -5,6 +5,7 @@ This file documents the revision history for Perl extension Mojo.
annoyances but might break some existing code if you are using long
versions of formerly aliased attributes.
- Fixed support for query strings.
- Fixed multi query parameter support.
- Added a context class to the Mojolicious generator.
- Cleaned up Mojo::Server api. (Mark Stosberg)
- Increased Mojo::Template perfromance. (Pedro Melo)
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojo.pm
Expand Up @@ -142,6 +142,8 @@ Robert Hicks
Shu Cho
Uwe Voelker
vti
And thanks to everyone else i might have forgotten. (Please send me a mail)
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message/Request.pm
Expand Up @@ -206,7 +206,7 @@ sub _parse_start_line {
^\s* # Start
([a-zA-Z]+) # Method
\s+ # Whitespace
([0-9a-zA-Z\$\-_\.\!\?\#\=\*\(\)\,\%\/]+) # Path
([0-9a-zA-Z\$\-_\.\!\?\#\=\*\(\)\,\%\/\&]+) # Path
(?:\s+HTTP\/(\d+)\.(\d+))? # Version (optional)
$ # End
/x) {
Expand Down
6 changes: 3 additions & 3 deletions t/mojo/message.t
Expand Up @@ -108,7 +108,7 @@ is_deeply($req->params->to_hash->{foo}, [qw/bar bar 13/]);

# Parse HTTP 1.1 chunked request with trailing headers
$req = Mojo::Message::Request->new;
$req->parse("POST /foo/bar/baz.html?foo=13#23 HTTP/1.1\x0d\x0a");
$req->parse("POST /foo/bar/baz.html?foo=13&bar=23#23 HTTP/1.1\x0d\x0a");
$req->parse("Content-Type: text/plain\x0d\x0a");
$req->parse("Transfer-Encoding: chunked\x0d\x0a");
$req->parse("Trailer: X-Trailer1; X-Trailer2\x0d\x0a\x0d\x0a");
Expand All @@ -123,8 +123,8 @@ is($req->state, 'done');
is($req->method, 'POST');
is($req->major_version, 1);
is($req->minor_version, 1);
is($req->url, '/foo/bar/baz.html?foo=13#23');
is($req->query_params, 'foo=13');
is($req->url, '/foo/bar/baz.html?foo=13&bar=23#23');
is($req->query_params, 'foo=13&bar=23');
is($req->headers->content_type, 'text/plain');
is($req->headers->header('X-Trailer1'), 'test');
is($req->headers->header('X-Trailer2'), '123');
Expand Down

0 comments on commit 5483c22

Please sign in to comment.