Skip Menu |

This queue is for tickets about the CGI-Lite CPAN distribution.

Report information
The Basics
Id: 41666
Status: resolved
Priority: 0/
Queue: CGI-Lite

People
Owner: HOUSTON [...] cpan.org
Requestors: dan.otterburn [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.02
Fixed in: 2.03



Subject: Invalid content type error on POST when charset included in Content-Type header
Hi, I get an "Invalid content type!" error when using parse_form_data('POST') to parse a POST with a "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" header. I understand that it is perfectly valid to include a charset in the Content-Type header. I guess: $content_type eq 'application/x-www-form-urlencoded' ...should be something along the lines of: $content_type =~ m{^application/x-www-form-urlencoded} Regards, Dan perl v5.10.0 built for i386-linux-thread-multi Fedora Linux 2.6.27.5-41.fc9.i686
Subject: Lite-2.02.pm.diff
--- Lite.pm 2008-12-12 21:00:37.000000000 +0000 +++ Lite.new.pm 2008-12-12 21:21:01.000000000 +0000 @@ -673,7 +673,7 @@ } elsif ($request_method =~ /^post$/i) { if (!$content_type || - ($content_type eq 'application/x-www-form-urlencoded')) { + ($content_type =~ m{^application/x-www-form-urlencoded})) { local $^W = 0;
Hello Dan, Thanks for your bug report and suggested patch. This is the same symptom and fix as issue 16236 and should be fixed in the next release. Pete On Fri Dec 12 16:23:36 2008, OTTERBURN wrote: Show quoted text
> Hi, > > I get an "Invalid content type!" error when using > parse_form_data('POST') to parse a POST with a "Content-Type: > application/x-www-form-urlencoded; charset=UTF-8" header. > > I understand that it is perfectly valid to include a charset in the > Content-Type header. > > I guess: > > $content_type eq 'application/x-www-form-urlencoded' > > ...should be something along the lines of: > > $content_type =~ m{^application/x-www-form-urlencoded} > > Regards, > > Dan > > perl v5.10.0 built for i386-linux-thread-multi > Fedora Linux 2.6.27.5-41.fc9.i686
This has been fixed in version 2.03. Parent ticket 16236 will be held as "patched" for the rest of this month - so please follow up there if you have any further comments on this issue.