| Index: runtime/bin/http_parser.dart
|
| diff --git a/runtime/bin/http_parser.dart b/runtime/bin/http_parser.dart
|
| index 571ce702496d493f2e83a5491d0470bb0a4311d6..a5549c5d3a519fceace71023d934c2330baab503 100644
|
| --- a/runtime/bin/http_parser.dart
|
| +++ b/runtime/bin/http_parser.dart
|
| @@ -428,6 +428,14 @@ class _HttpParser {
|
|
|
| case _State.HEADER_ENDING:
|
| _expect(byte, _CharCode.LF);
|
| + // If a request message has neither Content-Length nor
|
| + // Transfer-Encoding the message must not have a body (RFC
|
| + // 2616 section 4.3).
|
| + if (_messageType == _MessageType.REQUEST &&
|
| + _contentLength < 0 &&
|
| + _chunked == false) {
|
| + _contentLength = 0;
|
| + }
|
| if (_connectionUpgrade) {
|
| _state = _State.UPGRADED;
|
| _unparsedData =
|
| @@ -439,8 +447,6 @@ class _HttpParser {
|
| _state = _State.CHUNK_SIZE;
|
| _remainingContent = 0;
|
| } else if (_contentLength == 0 ||
|
| - (_messageType == _MessageType.REQUEST &&
|
| - _contentLength == -1) ||
|
| (_messageType == _MessageType.RESPONSE &&
|
| (_noMessageBody || _responseToMethod == "HEAD"))) {
|
| // If there is no message body get ready to process the
|
|
|