X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FDispatch%2FParamParser.pm;h=f70c366f48fef9d68a2c8d42411fcd9d02eb66a9;hb=206620dbbaa21806a311b19c2cfd81d9597d9f7c;hp=c6655026800974f91a9337ee145b52ff39dbd79c;hpb=d9ae38d990f923f213576fdc880e246842fdd6c2;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Dispatch/ParamParser.pm b/lib/Web/Dispatch/ParamParser.pm index c665502..f70c366 100644 --- a/lib/Web/Dispatch/ParamParser.pm +++ b/lib/Web/Dispatch/ParamParser.pm @@ -14,7 +14,7 @@ sub get_unpacked_query_from { sub get_unpacked_body_from { return $_[0]->{+UNPACKED_BODY} ||= do { - if (($_[0]->{CONTENT_TYPE}||'') eq 'application/x-www-form-urlencoded' + if (index(lc($_[0]->{CONTENT_TYPE}||''), 'application/x-www-form-urlencoded') >= 0 and defined $_[0]->{CONTENT_LENGTH}) { $_[0]->{'psgi.input'}->read(my $buf, $_[0]->{CONTENT_LENGTH}); _unpack_params($buf); @@ -24,6 +24,7 @@ sub get_unpacked_body_from { }; } + { # shamelessly stolen from HTTP::Body::UrlEncoded by Christian Hansen