BUG/MINOR: http-rules: Always replace the response status on a return action
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Feb 2021 10:41:01 +0000 (11:41 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 09:23:25 +0000 (10:23 +0100)
commit847cd956680a56356deddd761c4f6f718f7ecba5
tree0f0e38ff85d24fa2364b32d2781577944874748c
parent0dccf89c5f1f4f8c82a16a69004410d71eb37484
BUG/MINOR: http-rules: Always replace the response status on a return action

When a HTTP return action is triggered, HAProxy is responsible to return the
response, based on the configured status code. On the request side, there is
no problem because there is no server response to replace. But on the
response side, we must take care to override the server response status
code, if any, to be sure to use the rigth status code to get the http reply
message.

In short, we must always set the configured status code of the HTTP return
action before returning the http reply to be sure to get the right reply,
the one base on the http return action status code and not a reply based on
the server response status code..

This patch should fix the issue #1139. It must be backported as far as 2.2.

(cherry picked from commit 2d36df275b1323cfae8105b5a39f6cfb96f50811)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_act.c