Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: sdk/lib/io/http_parser.dart

Issue 169723003: Allow HTTP response without reason phrase (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/http_no_reason_phrase_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | tests/standalone/io/http_no_reason_phrase_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698