]> git.ipfire.org Git - thirdparty/git.git/commit - http-backend.c
http-backend: allow empty CONTENT_LENGTH
authorMax Kirillov <max@max630.net>
Fri, 7 Sep 2018 03:36:07 +0000 (06:36 +0300)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Sep 2018 19:35:51 +0000 (12:35 -0700)
commit574c513e8dda5598e9e08e8ca2a048bf120a5709
treea2088dcfd3318c89bfda556e45c8347b31f30341
parenteebfe409628e337e283d57a870f52ae0d0e0de34
http-backend: allow empty CONTENT_LENGTH

According to RFC3875, empty environment variable is equivalent to unset,
and for CONTENT_LENGTH it should mean zero body to read.

However, unset CONTENT_LENGTH is also used for chunked encoding to indicate
reading until EOF. At least, the test "large fetch-pack requests can be split
across POSTs" from t5551 starts faliing, if unset or empty CONTENT_LENGTH is
treated as zero length body. So keep the existing behavior as much as possible.

Add a test for the case.

Reported-By: Jelmer Vernooij <jelmer@jelmer.uk>
Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-backend.c
t/t5562-http-backend-content-length.sh