diff options
-rw-r--r-- | lib/Web/Request.pm | 3 | ||||
-rw-r--r-- | t/uri.t | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lib/Web/Request.pm b/lib/Web/Request.pm index 597530e..6b53b7c 100644 --- a/lib/Web/Request.pm +++ b/lib/Web/Request.pm @@ -112,8 +112,7 @@ has uri => ( # in, we recognize it as /foo/bar which is not ideal, but that's # how the PSGI PATH_INFO spec goes and we can't do anything # about it. See PSGI::FAQ for details. - # http://github.com/miyagawa/Plack/issues#issue/118 - my $path_escape_class = '^A-Za-z0-9\-\._~/'; + my $path_escape_class = q{^/;:@&=A-Za-z0-9\$_.+!*'(),-}; my $path = URI::Escape::uri_escape( $self->path_info || '', @@ -45,6 +45,13 @@ my @tests = ( }, uri => 'http://example.com/exec/', parameters => {} }, + + { add_env => { + HTTP_HOST => 'example.com', + SCRIPT_NAME => '/exec/' + }, + uri => 'http://example.com/exec/', + parameters => {} }, { add_env => { SERVER_NAME => 'example.com' }, @@ -87,7 +94,15 @@ my @tests = ( PATH_INFO => "/baz quux", }, uri => 'http://example.com/foo%20bar/baz%20quux', - parameters => {} } + parameters => {} }, + { add_env => { + HTTP_HOST => 'example.com', + SCRIPT_NAME => "/path", + PATH_INFO => "/parameters;path=one,two", + QUERY_STRING => "query=foobar", + }, + uri => 'http://example.com/path/parameters;path=one,two?query=foobar', + parameters => { query => "foobar" } }, ); for my $block (@tests) { |