Re: [PATCH] http-backend: Treat empty CONTENT_LENGTH as zero
- From
Jeff King <peff@peff.net>
- Date
- Sep 11, 2018, 01:58 UTC
- Message-ID
- <20180911015800.GB5838@sigill.intra.peff.net>
- In-Reply-To
- <20180910205359.32332-1-max@max630.net>
On Mon, Sep 10, 2018 at 11:53:59PM +0300, Max Kirillov wrote:
Show 11 quoted lines
> From: Jeff King <peff@peff.net> > Subject: [PATCH] http-backend: Treat empty CONTENT_LENGTH as zero > > There is no known case where empty body it used by a server as > instruction to read until EOF, so there is no need to violate the RFC. > Make get_content_length() return 0 in this case. > > Currently there is no practical difference, as the GET request > where it can be empty is handled without actual reading the body > (in get_info_refs() function), but it is better to stick to the correct > behavior.
There could be a difference if there is a server which actually sets CONTENT_LENGTH to the empty string for a chunked body. But we don't know of any such server at this point.
> Signed-off-by: Max Kirillov <max@max630.net> > --- > The incremental. Hopefully I described the reason right. Needs "signed-off-by"
Certainly this is:
Signed-off-by: Jeff King <peff@peff.net>
-Peff