]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: fcgi-app: Don't add C-L header on response to HEAD requests
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Apr 2022 13:29:34 +0000 (15:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 7 Apr 2022 09:04:07 +0000 (11:04 +0200)
commitd057960769f284e2e4ee9b38d3c99f28f656c71d
treedd0aa3220f19f13b60216836a30752728832ec42
parentb515b0af1d1bebda0def3028c213bd874f131c0d
BUG/MINOR: fcgi-app: Don't add C-L header on response to HEAD requests

In the FCGI app, when a full response is received, if there is no
content-length and transfer-encoding headers, a content-length header is
automatically added. This avoid, as far as possible to chunk the
response. This trick was added because, most of time, scripts don"t add
those headers.

But this should not be performed for response to HEAD requests. Indeed, in
this case, there is no payload. If the payload size is not specified, we
must not added it by hand. Otherwise, a "content-length: 0" will always be
added while it is not the real payload size (unknown at this stage).

This patch should solve issue #1639. It must be backported as far as 2.2.
src/fcgi-app.c