httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@ebuilt.com>
Subject Re: 400 instead of 413 for chunked request body too large?
Date Wed, 07 Nov 2001 02:56:48 GMT
On Tue, Nov 06, 2001 at 09:33:57PM -0500, Rodent of Unusual Size wrote:
> This is probably one for Roy..
> 
> I'm working on the test suite, against 1.3 at the moment
> because it's more stable and more likely to give me
> valid results to benchmark.
> 
> With 1.3, when I send an unchunked content-body that
> exceeds the LimitRequestBody limit, the response is
> 413 (Request Entity Too Large).
> 
> When I do the same except with a chunked body, I get a
> 400 (Bad Request), although the body of the response
> shows a correct diagnosis: "Chunked request body is larger
> than the configured limit of <n>".

Hmmm, wondering why... line 2039 of http_protocol.c, that's why.

Oh, right.  The problem is that the 1.3 API assumes that the decision on
what status to return has already been made, so it only barfs on the
request body with a -1 error response rather than a status code.  You
might want to try setting

   r->status = HTTP_REQUEST_ENTITY_TOO_LARGE;

just prior to the return, but side-effects like that leave me queesy.

> So, question: Shouldn't that also be a 413?  If so, 1.3
> is broken in this respect (and possibly 2.0 as well; I
> haven't tested it yet).

It should be 413 in theory, but it isn't critical.

....Roy


Mime
View raw message