Skip Menu |
 

This queue is for tickets about the HTTP-Server-Simple CPAN distribution.

Report information
The Basics
Id: 22675
Status: resolved
Priority: 0/
Queue: HTTP-Server-Simple

People
Owner: Nobody in particular
Requestors: yann [...] sixapart.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: extra unescaping ?
Download (untitled) / with headers
text/plain 152b
Hi, I'm not sure why there's escaping occuring at this place in the code. It looks to me that it's causing issues with CGI.pm What do you think? Yann
Subject: http-server-simple.patch
diff -ru HTTP-Server-Simple-0.23/lib/HTTP/Server/Simple.pm HTTP-Server-Simple-0.23.patched/lib/HTTP/Server/Simple.pm --- HTTP-Server-Simple-0.23/lib/HTTP/Server/Simple.pm 2006-10-22 23:24:37.000000000 -0700 +++ HTTP-Server-Simple-0.23.patched/lib/HTTP/Server/Simple.pm 2006-10-27 16:58:51.000000000 -0700 @@ -4,7 +4,6 @@ use FileHandle; use Socket; use Carp; -use URI::Escape; use vars qw($VERSION $bad_request_doc); $VERSION = '0.23'; @@ -526,7 +525,7 @@ my $uri = $2 || ''; my $protocol = $3 || ''; - return ( $method, uri_unescape( $uri ), $protocol ); + return ( $method, $uri, $protocol ); } =head2 parse_headers diff -ru HTTP-Server-Simple-0.23/t/04cgi.t HTTP-Server-Simple-0.23.patched/t/04cgi.t --- HTTP-Server-Simple-0.23/t/04cgi.t 2006-10-18 20:29:31.000000000 -0700 +++ HTTP-Server-Simple-0.23.patched/t/04cgi.t 2006-10-27 16:54:46.000000000 -0700 @@ -6,7 +6,7 @@ if ($@) { plan skip_all => "Data::Dumper not available"; }else { - plan tests => 20; + plan tests => 25; } use constant PORT => 13432; @@ -19,6 +19,7 @@ server_port => 'server_port: '.PORT, server_software => 'server_software: HTTP::Server::Simple/\d+.\d+', request_method => 'request_method: GET', + param => 'param', ); my %envvars=( @@ -46,6 +47,12 @@ select(undef,undef,undef,0.2); # wait a sec like(fetch("GET / HTTP/1.1",""), '/NOFILE/', 'no file'); + ## param tests + like(fetch("GET /cgitest/param?x=y HTTP/1.1",""), qr/param: y/, "simple param"); + like(fetch("GET /cgitest/param?x=%3Fnice HTTP/1.1",""), qr/param: \?nice/, "encoded param"); + like(fetch("GET /cgitest/param?x=%253F HTTP/1.1",""), qr/param: %3F/, "dbl encoded param"); + like(fetch("GET /cgitest/param?x=%253Fother=%3F= HTTP/1.1",""), qr/param: %3Fother=\?=/, "dbl encoded param"); + foreach my $method (keys(%methods)) { like( fetch("GET /cgitest/$method HTTP/1.1",""), @@ -155,7 +162,9 @@ print "HTTP/1.0 200 OK\r\n"; # probably OK by now print "Content-Type: text/html\r\nContent-Length: "; my $response; - if($methods{$file}) { + if ($file eq 'param') { + $response = "param: ". $cgi->param('x'); + } elsif($methods{$file}) { $response = "$file: ".$cgi->$file(); } elsif($envvars{$file}) { $response="$file: $ENV{$file}";
Download (untitled) / with headers
text/plain 322b
On Fri Oct 27 20:00:32 2006, YANNK wrote: Show quoted text
> Hi, I'm not sure why there's escaping occuring at this place in the > code. It looks to me that it's causing issues with CGI.pm > > What do you think? > > Yann
Hi Yann, (Sorry for the delayed response!) We're no longer escaping the $uri in parse_request as of 0.29. Shawn


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.