Skip Menu |

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

Report information
The Basics
Id: 106237
Status: resolved
Priority: 0/
Queue: HTTP-Message

People
Owner: Nobody in particular
Requestors: DCPETROV [...] cpan.org
Cc:
AdminCc:

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



Subject: URI params are not escaped correctly
I have simple script which passes something like: #!/usr/bin/env perl use strict; use warnings; use HTTP::Request::Common qw/GET POST DELETE/; use Data::Dumper; my $req = GET 'http://localhost/events?search={"basetag":{"-like":"%devAAAAAAAA%"}}'; warn Dumper( $req->uri->query_form ); Result: $VAR1 = 'search'; $VAR2 = '{"basetag":{"-like":"�vAAAAAAAA%"}}'; It seems like the params are not escaped correctly.
On 2015-08-03 16:56:42, DCPETROV wrote: Show quoted text
> I have simple script which passes something like: > > #!/usr/bin/env perl > use strict; > use warnings; > use HTTP::Request::Common qw/GET POST DELETE/; > use Data::Dumper; > > my $req = GET 'http://localhost/events?search={"basetag":{"- > like":"%devAAAAAAAA%"}}'; > > warn Dumper( $req->uri->query_form ); > > Result: > $VAR1 = 'search'; > $VAR2 = '{"basetag":{"-like":"�vAAAAAAAA%"}}'; > > It seems like the params are not escaped correctly.
I think it's not the job of HTTP::* to escape something here. After all, the user maybe wanted to use the "%de" escape deliberately. If you want to escape, then you should use a module like URI::QueryParam: my $u = URI->new('http://localhost/events'); $u->query_param('search', '{"basetag":{"-like":"%devAAAAAAAA%"}}'); warn Dumper($u->query_form); Result $VAR1 = 'search'; $VAR2 = '{"basetag":{"-like":"%devAAAAAAAA%"}}';