You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2001/11/07 03:33:57 UTC

400 instead of 413 for chunked request body too large?

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>".

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).
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: 400 instead of 413 for chunked request body too large?

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
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