]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http-htx: Don't return error if authority is updated without changes
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Feb 2020 10:02:21 +0000 (11:02 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 18 Feb 2020 10:19:57 +0000 (11:19 +0100)
commit34b18e439129ca9df17ff46e60d009bb308d064a
tree3d90fff8f45256635c2134cfa218b414a0ff4e0a
parent9c44e4813cbd3c0f7ed6e2840342d45dea9ed4ff
BUG/MINOR: http-htx: Don't return error if authority is updated without changes

When an Host header is updated, the autority part, if any, is also updated to
keep the both syncrhonized. But, when the update is performed while there is no
change, a failure is reported while, in reality, no update is necessary. This
bug was introduced by the commit d7b7a1ce5 ("MEDIUM: http-htx: Keep the Host
header and the request start-line synchronized").

This commit was pushed in the 2.1. But on this version, the bug is hidden
because rewrite errors are silently ignored. And because it happens when there
is no change, if the rewrite fails, noone notices it. But since the 2.2, rewrite
errors are now fatals by default. So when the bug is hit, a 500 error is
returned to the client. Without this fix, a workaround is to disable the strict
rewriting mode (see the "strict-mode" HTTP rule).

The following HTTP rule is a good way to reproduce the bug if a request with an
authority is received. In HTT2, it is pretty common.

    acl host_header_exists req.hdr(host) -m found
    http-request set-header host %[req.hdr(host)] if host_header_exists

This patch must be backported to 2.1 and everywhere the commit d7b7a1ce5 is
backported. It should fix the issue #494.
src/http_htx.c