]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http-htx: Expect no body for 204/304 internal HTTP responses
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Oct 2020 06:50:26 +0000 (08:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Oct 2020 08:02:09 +0000 (10:02 +0200)
commitb8d148a93f0daff9821cb9ecc5934499f8d128a2
treeb7d009aff2beb177aed8d83709eb136c47c0cbf7
parent55633925545717466597d8863cee9c137082eade
BUG/MINOR: http-htx: Expect no body for 204/304 internal HTTP responses

204 and 304 HTTP responses must no contain message body. These status codes are
correctly handled when the responses are received from a server. But there is no
specific processing for internal HTTP reponses (errorfile and http replies).

Now, when errorfiles or an http replies are parsed during the configuration
parsing, an error is triggered if a 204/304 message contains a body. An extra
check is also performed to ensure the body length matches the announce
content-length.

This patch should fix the issue #891. It must be backported as far as 2.0. For
2.1 and 2.0, only the http_str_to_htx() function must be fixed.
http_parse_http_reply() function does not exist.
src/http_htx.c