Merge up from 5.70 trunk:
Tomas Doran [Tue, 13 Jan 2009 23:38:36 +0000 (23:38 +0000)]
r9021 | andyg | 2009-01-06 19:42:41 +0000 (Tue, 06 Jan 2009) | 1 line

Handle leading CRLF in HTTP requests sometimes sent by IE6 in keep-alive requests

Changes
lib/Catalyst/Engine/HTTP.pm

diff --git a/Changes b/Changes
index 64e358a..adb3172 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 # This file documents the revision history for Perl extension Catalyst.
 
 5.8000_05
+        - Handle leading CRLF in HTTP requests sometimes sent by IE6 in 
+          keep-alive requests. (andyg)
         - Fixes for FastCGI with IIS 6.0 (janus)
         - Passing request method exported by Catalyst::Test an extra
           parameter used to be ignored, but started breaking if the parameter
index f7a13ea..1163244 100644 (file)
@@ -445,7 +445,8 @@ sub _parse_request_line {
     my $self = shift;
 
     # Parse request line
-    if ( $self->{inputbuf} !~ s/^(\w+)[ \t]+(\S+)(?:[ \t]+(HTTP\/\d+\.\d+))?[^\012]*\012// ) {
+    # Leading CRLF sometimes sent by buggy IE versions
+    if ( $self->{inputbuf} !~ s/^(?:\x0D\x0A)?(\w+)[ \t]+(\S+)(?:[ \t]+(HTTP\/\d+\.\d+))?[^\012]*\012// ) {
         return ();
     }