Skip Menu |

This queue is for tickets about the Perlbal CPAN distribution.

Report information
The Basics
Id: 76692
Status: new
Priority: 0/
Queue: Perlbal

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: srezic [...] iconmobile.com
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.79
  • 1.80
Fixed in: (no value)



Subject: Allow HTTP status line without phrase part
Perlbal::HTTPHeaders is quite strict about the status line in an HTTP response: # check for valid response line return fail("Bogus response line") unless $self->{responseLine} =~ m!^HTTP\/(\d+)\.(\d+)\s+(\d+)(?:\s+(.*))$!; This means that the status line must contain both the response code *and* the human-readable phrase. While the human-readable phrase itself may be empty, the space between code and phrase is mandatory. This seems to agree with the HTTP RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 However it seems that it's possible that servers may incorrectly omit the human-readable phrase in the response. For example, it is easy to build such a response using CGI.pm #!/usr/bin/perl use CGI 'redirect'; print redirect( -uri => 'http://www.perl.org', -status => '301', # no phrase #-status => '301 Moved', # this would be correct ); __END__ Browsers like firefox can deal with this response. HTTP::Response also does not care about the missing phrase, so all things using LWP::UserAgent also work. Perlbal throws an error here, and blocks the connection to the client until it times out. I wonder if Perlbal could be also lax here and allow a missing phrase. See also a related ticket in the CGI queue: https://rt.cpan.org/Ticket/Display.html?id=76691 Regards, Slaven