Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id:
75592
Status:
resolved
Priority:
Low/Low
Queue:

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

BugTracker
Severity:
Critical
Broken in:
6.03
Fixed in:
  • 6.00
  • 6.01
  • 6.02



Subject: RFC Violation - Broken POST content
Hello Gisle, I accidentally upgraded to HTTP::Message 6.03 and now the urlencoding is suddenly broken for special binary uploads. Rolling back to version 6.02 repairs all the problems. But the new version is corrupting too much!
I found the problem. HTTP/Request/Common.pm:85: # HTML/4.01 says that line breaks are represented as "CR LF" pairs (i.e., `%0D%0A') HTTP/Request/Common.pm:86: $content =~ s/(?<!%0D)%0A/%0D%0A/g; That's a nifty little negative lookbehind substitution, but "%0A" is not a newline. In fact, it all three characters fit on one line. And modifying already-encoded binary data isn't being helpful at all.
Here is the patch we are using in production that corrects the problem.
Subject: http-message-603_01.patch
--- /usr/local/lib/perl5/site_perl/5.8.8/HTTP/Request/Common.pm.BROKE 2012-02-16 16:14:03.000000000 -0600 +++ /usr/local/lib/perl5/site_perl/5.8.8/HTTP/Request/Common.pm 2012-03-06 18:21:42.000000000 -0600 @@ -82,8 +82,8 @@ $url->query_form(ref($content) eq "HASH" ? %$content : @$content); $content = $url->query; - # HTML/4.01 says that line breaks are represented as "CR LF" pairs (i.e., `%0D%0A') - $content =~ s/(?<!%0D)%0A/%0D%0A/g; + # HTML/4.01 says that line breaks are represented as "CR LF" pairs + $content =~ s/(?<!\x0d)\x0a/\x0d\x0a/g; } }
Since the new behaviour is to encode "\n" as "\r\n" for application/x−www−form−urlencoded parts this is clearly not transparant if you try to pass through binary data. I can see that. The new behaviour only make sense to text content (where you emulate an HTML form). I don't know what you mean by RFC Violation. The patch that introduced this behaviour claimed the the old behaviour conflicted with the HTTP RFC. What RFC do you claim say otherwise? Binary parts would normally be handled by using the multipart/form−data format instead. Your patch is broken. It breaks the test suite and works for you simply be effectively disabling the statement it affects. Thus reverting to the old behaviour. I think it ought to be possible use this interface and get transparent binary encoding as well. Not quite sure how yet.
Gisle, Thank you for your response! I understand that HTTP RFC 2068 suggests that CRLF be used across the wire to fully comply. And I believe it might even be appropriate to convert multipart/form−data fields (that happen to be text/*) to CRLF format so that everything across the raw transport is standard. But there is nothing in RFC 1738 that suggests you can inject extra characters during the encoding process for application/x−www−form−urlencoded data. And "%0A" is just three digits in plain text without any special characters so should be safe across the wire as is, thus the violation referred to in my report. However, I have seen SOME real browsers such as IE encode textarea inputs with forced CRLF prior to encoding, which I believe your 6.03 will help emulate this behavior. I'm not sure what any RFC states about that or where that idea even comes from or if that is even proper or not. And if this behavior I've seen is proper, then yes, my patch would break that. Unfortunately, I'm not sure how to tell LWP::UserAgent or HTTP::Request when I know that my content is not text and should not be corrupted in this case. I just know that everything used to work fine for years posting binary inputs, and suddenly after upgrading to 6.03 it is broken. I guess I can double URL encode it on the client end and then double decode it on the server end to workaround any encoding issues with HTTP::Request, but that would require changes on both ends and doesn't provide a slow migration path very easily. I'm just not sure what the best solution is. And which RFC are you claiming that the OLD behavior does not comply? Or do you have any other suggestions?
This has caused a module of mine to malfunction under some circumstances. We calculate an md5 of the text we're sending to the server to ensure it isn't harmed in transit. Well, with 6.03 it is - the text the server receives no longer matches the md5. I've attached a transcript of a shell session showing how I determined that this release is responsible. I don't know whether an RFC is violated, but I do know this change is causing problems.
Subject: http-message-test.log
mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ prove t/05-revert.t -v t/05-revert.t .. 1..2 # { # 'error' => { # 'code' => 3, # 'details' => 'badmd5: The supplied MD5 hash was incorrect', # 'stacktrace' => 'badmd5: The supplied MD5 hash was incorrect at /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/MediaWiki/API.pm line 444. # MediaWiki::API::api(\'MediaWiki::API=HASH(0x17ce990)\', \'HASH(0x1c42b50)\') called at /home/mike/code/git/LIFEGUARD/MediaWiki-Bot/lib/MediaWiki/Bot.pm line 656 # MediaWiki::Bot::edit(\'MediaWiki::Bot=HASH(0x1091b48)\', \'HASH(0x1a10508)\') called at /home/mike/code/git/LIFEGUARD/MediaWiki-Bot/lib/MediaWiki/Bot.pm line 1038 # MediaWiki::Bot::revert(\'MediaWiki::Bot=HASH(0x1091b48)\', \'User:Mike.lifeguard/05-revert.t\', 128592, \'MediaWiki::Bot tests (t/05-revert.t)\') called at t/05-revert.t line 32 # ' # }, # 'revid' => 128592, # 'text' => 'section zero # # ==A normal section header== # text' # } ok 1 # skip Cannot proceed with editing tests ok 2 # skip Cannot proceed with editing tests ok All tests successful. Files=1, Tests=2, 5 wallclock secs ( 0.02 usr 0.02 sys + 0.20 cusr 0.03 csys = 0.27 CPU) Result: PASS mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ cpan cpan> i HTTP::Headers::Util Reading '/home/mike/.cpan/Metadata' Database was generated on Fri, 30 Mar 2012 21:44:33 GMT Module id = HTTP::Headers::Util CPAN_USERID GAAS (Gisle Aas <gisle@ActiveState.com>) CPAN_VERSION 6.03 CPAN_FILE G/GA/GAAS/HTTP-Message-6.03.tar.gz UPLOAD_DATE 2012-02-16 MANPAGE HTTP::Headers::Util - Header value parsing utility functions INST_FILE /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Headers/Util.pm INST_VERSION 6.03 cpan> install GAAS/HTTP-Message-6.00.tar.gz Running make for G/GA/GAAS/HTTP-Message-6.00.tar.gz Fetching with LWP: https://cpan.metacpan.org/authors/id/G/GA/GAAS/HTTP-Message-6.00.tar.gz Checksum for /home/mike/.cpan/sources/authors/id/G/GA/GAAS/HTTP-Message-6.00.tar.gz ok Scanning cache /home/mike/.cpan/build for sizes ....------------------------------------------------------------------------DONE DEL(1/66): /home/mike/.cpan/build/PAR-Packer-1.013-M6Q7Gy DEL(2/66): /home/mike/.cpan/build/PAR-Packer-1.013-M6Q7Gy.yml DEL(3/66): /home/mike/.cpan/build/PPIx-Regexp-0.026-BBiCoF DEL(4/66): /home/mike/.cpan/build/PPIx-Regexp-0.026-BBiCoF.yml DEL(5/66): /home/mike/.cpan/build/Package-DeprecationManager-0.13-VGA4c1 DEL(6/66): /home/mike/.cpan/build/Package-DeprecationManager-0.13-VGA4c1.yml DEL(7/66): /home/mike/.cpan/build/Params-Util-1.07-o715rU DEL(8/66): /home/mike/.cpan/build/Params-Util-1.07-o715rU.yml DEL(9/66): /home/mike/.cpan/build/Params-Validate-1.06-qqy7g_ DEL(10/66): /home/mike/.cpan/build/Params-Validate-1.06-qqy7g_.yml DEL(11/66): /home/mike/.cpan/build/Path-Class-0.25-Zmc7HI DEL(12/66): /home/mike/.cpan/build/Path-Class-0.25-Zmc7HI.yml DEL(13/66): /home/mike/.cpan/build/Plack-0.9986-gigDyH DEL(14/66): /home/mike/.cpan/build/Plack-0.9986-gigDyH.yml DEL(15/66): /home/mike/.cpan/build/Pod-Coverage-0.22-wb7yMf DEL(16/66): /home/mike/.cpan/build/Pod-Coverage-0.22-wb7yMf.yml DEL(17/66): /home/mike/.cpan/build/Pod-LaTeX-0.60-05_luu DEL(18/66): /home/mike/.cpan/build/Pod-LaTeX-0.60-05_luu.yml DEL(19/66): /home/mike/.cpan/build/Pod-Parser-1.51-b4AGbc DEL(20/66): /home/mike/.cpan/build/Pod-Parser-1.51-b4AGbc.yml DEL(21/66): /home/mike/.cpan/build/Pod-Perldoc-3.17-d5QTOc DEL(22/66): /home/mike/.cpan/build/Pod-Perldoc-3.17-d5QTOc.yml DEL(23/66): /home/mike/.cpan/build/Pod-Simple-3.20-2ynCiK DEL(24/66): /home/mike/.cpan/build/Pod-Simple-3.20-2ynCiK.yml DEL(25/66): /home/mike/.cpan/build/Pod-Weaver-3.101635-LjXQzs DEL(26/66): /home/mike/.cpan/build/Pod-Weaver-3.101635-LjXQzs.yml DEL(27/66): /home/mike/.cpan/build/Pod-Wordlist-hanekomu-1.120740-unQh0T DEL(28/66): /home/mike/.cpan/build/Pod-Wordlist-hanekomu-1.120740-unQh0T.yml DEL(29/66): /home/mike/.cpan/build/Dist-Zilla-Plugin-TaskWeaver-0.101622-LBcwzg DEL(30/66): /home/mike/.cpan/build/Dist-Zilla-Plugin-TaskWeaver-0.101622-LBcwzg.yml DEL(31/66): /home/mike/.cpan/build/Role-Tiny-1.000000-ZEhUY3 DEL(32/66): /home/mike/.cpan/build/Role-Tiny-1.000000-ZEhUY3.yml DEL(33/66): /home/mike/.cpan/build/Socket-2.001-U8xjoV DEL(34/66): /home/mike/.cpan/build/Socket-2.001-U8xjoV.yml DEL(35/66): /home/mike/.cpan/build/String-Flogger-1.101242-5QUO9f DEL(36/66): /home/mike/.cpan/build/String-Flogger-1.101242-5QUO9f.yml DEL(37/66): /home/mike/.cpan/build/Sub-Install-0.926-ifSr1M DEL(38/66): /home/mike/.cpan/build/Sub-Install-0.926-ifSr1M.yml DEL(39/66): /home/mike/.cpan/build/Sub-Uplevel-0.24-RsocLB DEL(40/66): /home/mike/.cpan/build/Sub-Uplevel-0.24-RsocLB.yml DEL(41/66): /home/mike/.cpan/build/Term-ANSIColor-3.02-ce8vVh DEL(42/66): /home/mike/.cpan/build/Term-ANSIColor-3.02-ce8vVh.yml DEL(43/66): /home/mike/.cpan/build/Term-ReadLine-1.09-nwJLIg DEL(44/66): /home/mike/.cpan/build/Term-ReadLine-1.09-nwJLIg.yml DEL(45/66): /home/mike/.cpan/build/Text-Xslate-1.5009-Sk90gg DEL(46/66): /home/mike/.cpan/build/Text-Xslate-1.5009-Sk90gg.yml DEL(47/66): /home/mike/.cpan/build/Tie-File-0.98-NbpOkk DEL(48/66): /home/mike/.cpan/build/Tie-File-0.98-NbpOkk.yml DEL(49/66): /home/mike/.cpan/build/Time-HiRes-1.9725-mxEcWL DEL(50/66): /home/mike/.cpan/build/Time-HiRes-1.9725-mxEcWL.yml DEL(51/66): /home/mike/.cpan/build/URI-1.60-uusz4L DEL(52/66): /home/mike/.cpan/build/URI-1.60-uusz4L.yml DEL(53/66): /home/mike/.cpan/build/version-0.97-ufKjsm DEL(54/66): /home/mike/.cpan/build/version-0.97-ufKjsm.yml DEL(55/66): /home/mike/.cpan/build/WWW-Mechanize-1.72-k2QzKR DEL(56/66): /home/mike/.cpan/build/WWW-Mechanize-1.72-k2QzKR.yml DEL(57/66): /home/mike/.cpan/build/YAML-Syck-1.20-HGfZ9J DEL(58/66): /home/mike/.cpan/build/YAML-Syck-1.20-HGfZ9J.yml DEL(59/66): /home/mike/.cpan/build/YAML-Tiny-1.51-nUZfQ4 DEL(60/66): /home/mike/.cpan/build/YAML-Tiny-1.51-nUZfQ4.yml DEL(61/66): /home/mike/.cpan/build/MediaWiki-API-0.37-hiUYCs DEL(62/66): /home/mike/.cpan/build/Module-Versions-Report-1.06-UrrtUX DEL(63/66): /home/mike/.cpan/build/Module-Versions-Report-1.06-UrrtUX.yml DEL(64/66): /home/mike/.cpan/build/Module-Versions-Report-1.06-RFI0aT DEL(65/66): /home/mike/.cpan/build/Digest-MD5-2.39-ZzxRqh DEL(66/66): /home/mike/.cpan/build/Encode-2.35-UgHJl7 CPAN.pm: Building G/GA/GAAS/HTTP-Message-6.00.tar.gz Checking if your kit is complete... Looks good Writing Makefile for HTTP::Message Writing MYMETA.yml and MYMETA.json (/home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 Makefile.PL exited with 0) CPAN::Reporter: Makefile.PL result is 'pass', No errors. cp lib/HTTP/Status.pm blib/lib/HTTP/Status.pm cp lib/HTTP/Headers/Auth.pm blib/lib/HTTP/Headers/Auth.pm cp lib/HTTP/Request.pm blib/lib/HTTP/Request.pm cp lib/HTTP/Headers/ETag.pm blib/lib/HTTP/Headers/ETag.pm cp lib/HTTP/Config.pm blib/lib/HTTP/Config.pm cp lib/HTTP/Headers/Util.pm blib/lib/HTTP/Headers/Util.pm cp lib/HTTP/Request/Common.pm blib/lib/HTTP/Request/Common.pm cp lib/HTTP/Message.pm blib/lib/HTTP/Message.pm cp lib/HTTP/Response.pm blib/lib/HTTP/Response.pm cp lib/HTTP/Headers.pm blib/lib/HTTP/Headers.pm Manifying blib/man3/HTTP::Status.3 Manifying blib/man3/HTTP::Request.3 Manifying blib/man3/HTTP::Request::Common.3 Manifying blib/man3/HTTP::Headers::Util.3 Manifying blib/man3/HTTP::Config.3 Manifying blib/man3/HTTP::Message.3 Manifying blib/man3/HTTP::Response.3 Manifying blib/man3/HTTP::Headers.3 (/usr/bin/make exited with 0) CPAN::Reporter: make result is 'pass', No errors. GAAS/HTTP-Message-6.00.tar.gz /usr/bin/make -- OK 'YAML' not installed, will not store persistent state Running make test PERL_DL_NONLAZY=1 /home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/common-req.t .......... ok t/headers-auth.t ........ ok t/headers-etag.t ........ ok t/headers-util.t ........ ok t/headers.t ............. ok t/http-config.t ......... ok t/message-charset.t ..... ok t/message-decode-xml.t .. ok t/message-old.t ......... ok t/message-parts.t ....... ok t/message.t ............. ok t/request.t ............. ok t/response.t ............ ok t/status-old.t .......... ok t/status.t .............. ok All tests successful. Files=15, Tests=531, 1 wallclock secs ( 0.11 usr 0.04 sys + 0.85 cusr 0.08 csys = 1.08 CPU) Result: PASS (/usr/bin/make test exited with 0) CPAN::Reporter: Test result is 'pass', All tests successful. CPAN::Reporter: preparing a CPAN Testers report for HTTP-Message-6.00 CPAN::Reporter: sending test report with 'pass' via Metabase GAAS/HTTP-Message-6.00.tar.gz /usr/bin/make test -- OK Running make install Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Message.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Response.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Status.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Headers/Util.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Request/Common.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Message.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Response.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request::Common.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Config.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Status.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers::Util.3 Appending installation info to /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux/perllocal.pod GAAS/HTTP-Message-6.00.tar.gz /usr/bin/make install -- OK cpan> Lockfile removed. mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ prove t/05-revert.t -v t/05-revert.t .. 1..2 # { # 'error' => undef, # 'revid' => 128592, # 'text' => 'section zero # # ==A normal section header== # text' # } ok 1 - Reverted successfully ok 2 - Undo was successful ok All tests successful. Files=1, Tests=2, 8 wallclock secs ( 0.04 usr 0.00 sys + 0.22 cusr 0.07 csys = 0.33 CPU) Result: PASS mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ cpan cpan> install GAAS/HTTP-Message-6.02.tar.gz Reading '/home/mike/.cpan/Metadata' Database was generated on Fri, 30 Mar 2012 21:44:33 GMT Running make for G/GA/GAAS/HTTP-Message-6.02.tar.gz Checksum for /home/mike/.cpan/sources/authors/id/G/GA/GAAS/HTTP-Message-6.02.tar.gz ok Scanning cache /home/mike/.cpan/build for sizes ............................................................................DONE CPAN.pm: Building G/GA/GAAS/HTTP-Message-6.02.tar.gz Checking if your kit is complete... Looks good Writing Makefile for HTTP::Message Writing MYMETA.yml and MYMETA.json (/home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 Makefile.PL exited with 0) CPAN::Reporter: Makefile.PL result is 'pass', No errors. cp lib/HTTP/Status.pm blib/lib/HTTP/Status.pm cp lib/HTTP/Headers/Auth.pm blib/lib/HTTP/Headers/Auth.pm cp lib/HTTP/Request.pm blib/lib/HTTP/Request.pm cp lib/HTTP/Headers/ETag.pm blib/lib/HTTP/Headers/ETag.pm cp lib/HTTP/Config.pm blib/lib/HTTP/Config.pm cp lib/HTTP/Headers/Util.pm blib/lib/HTTP/Headers/Util.pm cp lib/HTTP/Request/Common.pm blib/lib/HTTP/Request/Common.pm cp lib/HTTP/Message.pm blib/lib/HTTP/Message.pm cp lib/HTTP/Response.pm blib/lib/HTTP/Response.pm cp lib/HTTP/Headers.pm blib/lib/HTTP/Headers.pm Manifying blib/man3/HTTP::Status.3 Manifying blib/man3/HTTP::Request.3 Manifying blib/man3/HTTP::Request::Common.3 Manifying blib/man3/HTTP::Headers::Util.3 Manifying blib/man3/HTTP::Config.3 Manifying blib/man3/HTTP::Message.3 Manifying blib/man3/HTTP::Response.3 Manifying blib/man3/HTTP::Headers.3 (/usr/bin/make exited with 0) CPAN::Reporter: make result is 'pass', No errors. GAAS/HTTP-Message-6.02.tar.gz /usr/bin/make -- OK 'YAML' not installed, will not store persistent state Running make test PERL_DL_NONLAZY=1 /home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/common-req.t .......... ok t/headers-auth.t ........ ok t/headers-etag.t ........ ok t/headers-util.t ........ ok t/headers.t ............. ok t/http-config.t ......... ok t/message-charset.t ..... ok t/message-decode-xml.t .. ok t/message-old.t ......... ok t/message-parts.t ....... ok t/message.t ............. ok t/request.t ............. ok t/response.t ............ ok t/status-old.t .......... ok t/status.t .............. ok All tests successful. Files=15, Tests=529, 1 wallclock secs ( 0.14 usr 0.01 sys + 0.65 cusr 0.18 csys = 0.98 CPU) Result: PASS (/usr/bin/make test exited with 0) CPAN::Reporter: Test result is 'pass', All tests successful. CPAN::Reporter: preparing a CPAN Testers report for HTTP-Message-6.02 CPAN::Reporter: sending test report with 'pass' via Metabase GAAS/HTTP-Message-6.02.tar.gz /usr/bin/make test -- OK Running make install Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Message.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Response.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Message.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Response.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request::Common.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Config.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Status.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers::Util.3 Appending installation info to /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux/perllocal.pod GAAS/HTTP-Message-6.02.tar.gz /usr/bin/make install -- OK cpan> Lockfile removed. mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ prove t/05-revert.t -v t/05-revert.t .. 1..2 # { # 'error' => undef, # 'revid' => 128594, # 'text' => 'section zero # # ==A normal section header== # text' # } ok 1 - Reverted successfully ok 2 - Undo was successful ok All tests successful. Files=1, Tests=2, 8 wallclock secs ( 0.03 usr 0.00 sys + 0.25 cusr 0.04 csys = 0.32 CPU) Result: PASS mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ cpan cpan> install GAAS/HTTP-Message-6.03.tar.gz Reading '/home/mike/.cpan/Metadata' Database was generated on Fri, 30 Mar 2012 21:44:33 GMT Running make for G/GA/GAAS/HTTP-Message-6.03.tar.gz Checksum for /home/mike/.cpan/sources/authors/id/G/GA/GAAS/HTTP-Message-6.03.tar.gz ok Scanning cache /home/mike/.cpan/build for sizes ............................................................................DONE CPAN.pm: Building G/GA/GAAS/HTTP-Message-6.03.tar.gz Checking if your kit is complete... Looks good Writing Makefile for HTTP::Message Writing MYMETA.yml and MYMETA.json (/home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 Makefile.PL exited with 0) CPAN::Reporter: Makefile.PL result is 'pass', No errors. cp lib/HTTP/Status.pm blib/lib/HTTP/Status.pm cp lib/HTTP/Headers/Auth.pm blib/lib/HTTP/Headers/Auth.pm cp lib/HTTP/Request.pm blib/lib/HTTP/Request.pm cp lib/HTTP/Headers/ETag.pm blib/lib/HTTP/Headers/ETag.pm cp lib/HTTP/Config.pm blib/lib/HTTP/Config.pm cp lib/HTTP/Headers/Util.pm blib/lib/HTTP/Headers/Util.pm cp lib/HTTP/Request/Common.pm blib/lib/HTTP/Request/Common.pm cp lib/HTTP/Message.pm blib/lib/HTTP/Message.pm cp lib/HTTP/Response.pm blib/lib/HTTP/Response.pm cp lib/HTTP/Headers.pm blib/lib/HTTP/Headers.pm Manifying blib/man3/HTTP::Status.3 Manifying blib/man3/HTTP::Request.3 Manifying blib/man3/HTTP::Request::Common.3 Manifying blib/man3/HTTP::Headers::Util.3 Manifying blib/man3/HTTP::Config.3 Manifying blib/man3/HTTP::Message.3 Manifying blib/man3/HTTP::Response.3 Manifying blib/man3/HTTP::Headers.3 (/usr/bin/make exited with 0) CPAN::Reporter: make result is 'pass', No errors. GAAS/HTTP-Message-6.03.tar.gz /usr/bin/make -- OK 'YAML' not installed, will not store persistent state Running make test PERL_DL_NONLAZY=1 /home/mike/perl5/perlbrew/perls/perl-5.14.2/bin/perl5.14.2 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/common-req.t .......... ok t/headers-auth.t ........ ok t/headers-etag.t ........ ok t/headers-util.t ........ ok t/headers.t ............. ok t/http-config.t ......... ok t/message-charset.t ..... ok t/message-decode-xml.t .. ok t/message-old.t ......... ok t/message-parts.t ....... ok t/message.t ............. ok t/request.t ............. ok t/response.t ............ ok t/status-old.t .......... ok t/status.t .............. ok All tests successful. Files=15, Tests=530, 1 wallclock secs ( 0.15 usr 0.00 sys + 0.82 cusr 0.03 csys = 1.00 CPU) Result: PASS (/usr/bin/make test exited with 0) CPAN::Reporter: Test result is 'pass', All tests successful. CPAN::Reporter: preparing a CPAN Testers report for HTTP-Message-6.03 CPAN::Reporter: this appears to be a duplicate report for the test phase: PASS HTTP-Message-6.03 x86_64-linux 2.6.32-34-generic Test report will not be sent. GAAS/HTTP-Message-6.03.tar.gz /usr/bin/make test -- OK Running make install Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Message.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Response.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Status.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Headers/Util.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/HTTP/Request/Common.pm Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Message.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Response.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request::Common.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Config.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Status.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Request.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers.3 Installing /home/mike/perl5/perlbrew/perls/perl-5.14.2/man/man3/HTTP::Headers::Util.3 Appending installation info to /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-linux/perllocal.pod GAAS/HTTP-Message-6.03.tar.gz /usr/bin/make install -- OK cpan> Lockfile removed. mike@charron:~/code/git/LIFEGUARD/MediaWiki-Bot (dev *)$ prove t/05-revert.t -v t/05-revert.t .. 1..2 # { # 'error' => { # 'code' => 3, # 'details' => 'badmd5: The supplied MD5 hash was incorrect', # 'stacktrace' => 'badmd5: The supplied MD5 hash was incorrect at /home/mike/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/MediaWiki/API.pm line 444. # MediaWiki::API::api(\'MediaWiki::API=HASH(0x2d0f990)\', \'HASH(0x3183b50)\') called at /home/mike/code/git/LIFEGUARD/MediaWiki-Bot/lib/MediaWiki/Bot.pm line 656 # MediaWiki::Bot::edit(\'MediaWiki::Bot=HASH(0x25d2b48)\', \'HASH(0x31836b8)\') called at /home/mike/code/git/LIFEGUARD/MediaWiki-Bot/lib/MediaWiki/Bot.pm line 1038 # MediaWiki::Bot::revert(\'MediaWiki::Bot=HASH(0x25d2b48)\', \'User:Mike.lifeguard/05-revert.t\', 128596, \'MediaWiki::Bot tests (t/05-revert.t)\') called at t/05-revert.t line 32 # ' # }, # 'revid' => 128596, # 'text' => 'section zero # # ==A normal section header== # text' # } ok 1 # skip Cannot proceed with editing tests ok 2 # skip Cannot proceed with editing tests ok All tests successful. Files=1, Tests=2, 4 wallclock secs ( 0.03 usr 0.00 sys + 0.21 cusr 0.02 csys = 0.26 CPU) Result: PASS
Looking at http://www.w3.org/Protocols/rfc2616/rfc2616- sec14.html#sec14.15 I see: "Conversion of all line breaks to CRLF MUST NOT be done" in reference to calculating a Content-MD5 header, which suggested to me that messing with my line endings was probably a bad idea. Then, I saw: "HTTP allows transmission of text types with any of several line break conventions and not just the canonical form using CRLF." which prompted me to look at http://www.w3.org/Protocols/rfc2616/rfc2616- sec3.html#sec3.7.1 which is more explicit. I'm certainly an amateur at reading RFCs, but it looks like you're not required to convert text types in the body to CRLF. If that's the case, please consider reverting this change.
Plus one to reverting conversion. Not only prepending every 0A with 0D completely breaks binary data, it is also not clear that "x-www-form-urlencoded" content-type is not suited for it, as many cache servers and existing communications depend on it. Actually, any silent alteration (and this is alteration, not some sort of transfer-encoding - server gets data different from what was sent by client) of user data seems very unnatural to me, not to mention breaking compatibility with previous versions. Issue warning (it is at most; I'm not sure that you got whole idea right).
Any progress here?


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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