From: Christopher Faulet Date: Fri, 13 Jun 2025 09:19:50 +0000 (+0200) Subject: BUG/MINOR: http-ana: Properly handle keep-query redirect option if no QS X-Git-Tag: v3.3-dev2~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=edb8f2bb60d11cc92895e6cf1cb05e5b6cdc51d7;p=thirdparty%2Fhaproxy.git BUG/MINOR: http-ana: Properly handle keep-query redirect option if no QS The keep-query redirect option must do nothing is there is no query-string. However, there is a bug. When there is no QS, an error is returned, leading to return a 500-internal-error to the client. To fix the bug, instead of returning 0 when there is no QS, we just skip the QS processing. This patch should fix the issue #3005. It must be backported as far as 3.1. --- diff --git a/src/http_ana.c b/src/http_ana.c index c0e290eb5..f42f47fe0 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -2482,7 +2482,7 @@ int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struc /* look up the '?' */ do { if (ptr == end) - return 0; + break; } while (*ptr++ != '?'); if (ptr == end)