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

Issue 9812005: Change the message body handling in the HTTP parser (Closed)

Created:
8 years, 9 months ago by Søren Gjesse
Modified:
8 years, 9 months ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Change the message body handling in the HTTP parser The message content detection and handling should now be more correct and according to the specification (RFC 2616 section 4.3). * Requests with no Content-Length and no Transfer-Encoding have no message body * Responses with status code 1xx, 204 and 304 have no message body * Responses which are responses to HEAD requests have no message body Also added support for detecting chunk-extensions and ignoring these. R=ajohnsen@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5722

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -41 lines) Patch
M runtime/bin/http_impl.dart View 2 chunks +5 lines, -0 lines 0 comments Download
M runtime/bin/http_parser.dart View 1 11 chunks +52 lines, -9 lines 0 comments Download
M tests/standalone/src/io/HttpParserTest.dart View 10 chunks +76 lines, -32 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Søren Gjesse
8 years, 9 months ago (2012-03-21 09:31:24 UTC) #1
Anders Johnsen
LGTM, really cool! :) https://chromiumcodereview.appspot.com/9812005/diff/1/runtime/bin/http_parser.dart File runtime/bin/http_parser.dart (right): https://chromiumcodereview.appspot.com/9812005/diff/1/runtime/bin/http_parser.dart#newcode192 runtime/bin/http_parser.dart:192: if (statusCode < 100 && ...
8 years, 9 months ago (2012-03-21 13:56:28 UTC) #2
Søren Gjesse
8 years, 9 months ago (2012-03-21 15:37:32 UTC) #3
https://chromiumcodereview.appspot.com/9812005/diff/1/runtime/bin/http_parser...
File runtime/bin/http_parser.dart (right):

https://chromiumcodereview.appspot.com/9812005/diff/1/runtime/bin/http_parser...
runtime/bin/http_parser.dart:192: if (statusCode < 100 && statusCode > 599) {
On 2012/03/21 13:56:28, ajohnsen wrote:
> Should be ||.

Done.

https://chromiumcodereview.appspot.com/9812005/diff/1/runtime/bin/http_parser...
runtime/bin/http_parser.dart:196: // Check whether this response will never have
a body.
On 2012/03/21 13:56:28, ajohnsen wrote:
> I guess that not all values between 100 and 599 are valid - would we gain
> anything if we tested against that?

According to RFC 2616 section 6.1.1 all status codes between 100 and 599 are
valid - though not all defined in the standard. Any status code Sxx (where  1 <=
S && S <= 5) which is not understood should be treated like a S00.

Powered by Google App Engine
This is Rietveld 408576698