]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http_ana: make sure redirect flags don't have overlapping bits
authorJerome Magnin <jmagnin@haproxy.com>
Thu, 27 Feb 2020 22:36:56 +0000 (23:36 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 27 Feb 2020 22:44:41 +0000 (23:44 +0100)
commit c87e46881 ("MINOR: http-rules: Add a flag on redirect rules to know the
rule direction") introduced a new flag for redirect rules, but its value has
bits in common with REDIRECT_FLAG_DROP_QS, which makes us enter this code path
in http_apply_redirect_rule(), which will then drop the query string.
To fix this, just give REDIRECT_FLAG_FROM_REQ its own unique value.

This must be backported where c87e46881687b8ddb9b3f459e60edb1e8d7c5d7c is backported.

This should fix issue 521.

include/types/http_ana.h

index bc66098585653c9d3882069202e3262008031b41..6740c03692f68130649e4524ed645b3185ef0262 100644 (file)
@@ -99,7 +99,7 @@ enum {
        REDIRECT_FLAG_NONE = 0,
        REDIRECT_FLAG_DROP_QS = 1,      /* drop query string */
        REDIRECT_FLAG_APPEND_SLASH = 2, /* append a slash if missing at the end */
-       REDIRECT_FLAG_FROM_REQ = 3,     /* redirect rule on the request path */
+       REDIRECT_FLAG_FROM_REQ = 4,     /* redirect rule on the request path */
 };
 
 /* Redirect types (location, prefix, extended ) */