-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix query params * cleanup param name regex
- Loading branch information
1 parent
2b82a87
commit 1c4c16c
Showing
3 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,5 +42,5 @@ | |
"Test::Util::ServerPort", | ||
"Cro::HTTP::Client" | ||
], | ||
"version": "2.1.3" | ||
"version": "2.1.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use v6; | ||
use strict; | ||
use lib 'lib'; | ||
|
||
use Test; | ||
use Humming-Bird::Core; | ||
|
||
plan 9; | ||
|
||
my $simple_raw_request = "GET /?foo=bar%40baz HTTP/1.1\r\nHost: bob.com\r\n"; | ||
my $simple_request = Request.decode($simple_raw_request); | ||
|
||
ok $simple_request.method === GET, 'Is method OK?'; | ||
is $simple_request.version, 'HTTP/1.1', 'Is version OK?'; | ||
is $simple_request.path, '/', 'Is path OK?'; | ||
is $simple_request.query('foo'), 'bar@baz', 'Is query param correct?'; | ||
|
||
my $advanced_raw_request = "GET /?foo=bar%40baz&j=123%40abc HTTP/1.1\r\nHost: bob.com\r\n"; | ||
my $advanced_request = Request.decode: $advanced_raw_request; | ||
|
||
ok $advanced_request.method === GET, 'Is method OK?'; | ||
is $advanced_request.version, 'HTTP/1.1', 'Is version OK?'; | ||
is $advanced_request.path, '/', 'Is path OK?'; | ||
is $advanced_request.query('foo'), 'bar@baz', 'Is first of query params correct?'; | ||
is $advanced_request.query('j'), '123@abc', 'Is second of query params correct?'; | ||
|
||
done-testing; |