Handle leading CRLF in HTTP requests sometimes sent by IE6 in keep-alive requests
Andy Grundman [Tue, 6 Jan 2009 19:42:41 +0000 (19:42 +0000)]
Changes
lib/Catalyst/Engine/HTTP.pm

diff --git a/Changes b/Changes
index a0272d4..e73ac51 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,6 +8,7 @@
         - Fix some Win32 test failures
         - Add pt translation of error message (wreis)
         - Make :Chained('../action') work (Florian Ragwitz)
+        - Handle leading CRLF in HTTP requests sometimes sent by IE6 in keep-alive requests.
 
 5.7099_03 2008-07-20 10:10:00
         - Fix regressions for regexp fallback in model(), view() and controller()
index d3d1c6d..6f66a39 100644 (file)
@@ -443,7 +443,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 ();
     }