Index: sdk/lib/io/http_parser.dart |
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart |
index 898092bb24e62d8bd76c0507a3f182d77ccb9718..0506a0503f61d021699b206394728e926be56f97 100644 |
--- a/sdk/lib/io/http_parser.dart |
+++ b/sdk/lib/io/http_parser.dart |
@@ -515,6 +515,10 @@ class _HttpParser |
throw new HttpException("Invalid response status code"); |
} |
_state = _State.RESPONSE_LINE_REASON_PHRASE; |
+ } else if (byte == _CharCode.CR) { |
+ // Some HTTP servers does not follow the spec. and send |
+ // \r\n right after the status code. |
+ _state = _State.RESPONSE_LINE_ENDING; |
} else { |
if (byte < 0x30 && 0x39 < byte) { |
throw new HttpException("Invalid response status code"); |