Merge up from 5.70 trunk:
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / HTTP.pm
index d35e604..1163244 100644 (file)
@@ -25,6 +25,10 @@ has _write_error => ( is => 'rw', predicate => '_has_write_error' );
 
 use namespace::clean -except => [qw/meta/];
 
+# Refactoring note - could/should Eliminate all instances of $self->{inputbuf},
+# which I haven't touched as it is used as an lvalue in a lot of places, and I guess
+# doing it differently could be expensive.. Feel free to refactor and NYTProf :)
+
 =head1 NAME
 
 Catalyst::Engine::HTTP - Catalyst HTTP Engine
@@ -441,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 ();
     }