1.00
- Added support for chunked requests if no $length value is passed to new().
+ - Fixed urlencoded parser to handle spaces after semicolons and equal signs
+ in the value. (Tom Heady, http://rt.cpan.org/Ticket/Display.html?id=31055)
0.9 2007-03-27 14:00:00
- Fixed bug where empty fields in multipart/form-data were ignored.
# Note: s/// appears faster than tr///
$self->{buffer} =~ s/\+/ /g;
- for my $pair ( split( /[&;]/, $self->{buffer} ) ) {
+ for my $pair ( split( /&|;(?:\s+)?/, $self->{buffer} ) ) {
- my ( $name, $value ) = split( /=/, $pair );
+ my ( $name, $value ) = split( /=/, $pair , 2 );
next unless defined $name;
next unless defined $value;
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 31;
use Cwd;
use Digest::MD5 qw(md5_hex);
my $path = catdir( getcwd(), 't', 'data', 'urlencoded' );
-for ( my $i = 1; $i <= 3; $i++ ) {
+for ( my $i = 1; $i <= 6; $i++ ) {
my $test = sprintf( "%.3d", $i );
my $headers = YAML::LoadFile( catfile( $path, "$test-headers.yml" ) );
--- /dev/null
+one=foo; two=bar
--- /dev/null
+---
+Content-Length: 16
+Content-Type: application/x-www-form-urlencoded
+User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+---
+body: ~
+param:
+ one: foo
+ two: bar
+upload: {}
--- /dev/null
+one=foo;two=bar
--- /dev/null
+---
+Content-Length: 15
+Content-Type: application/x-www-form-urlencoded
+User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+---
+body: ~
+param:
+ one: foo
+ two: bar
+upload: {}
--- /dev/null
+one=foo;two=bar=bam
--- /dev/null
+---
+Content-Length: 19
+Content-Type: application/x-www-form-urlencoded
+User-Agent: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)'
--- /dev/null
+---
+body: ~
+param:
+ one: foo
+ two: bar=bam
+upload: {}