From b2877db47c6a4c8637ac3ccefd4d16c3a38d1985 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 15 Nov 2024 17:03:06 +0100 Subject: [PATCH] MINOR: http-ana: Add option to keep query-string on a localtion-based redirect On prefix-based redirect, there is an option to drop the query-string of the location. Here it is the opposite. an option is added to preserve the query-string of the original URI for a localtion-based redirect. By setting "keep-query" option, for a location-based redirect only, the query-string of the original URI is appended to the location. If there is no query-string, nothing is added (no empty '?'). If there is already a non-empty query-string on the localtion, the original one is appended with '&' separator. This patch should fix issue #2728. --- doc/configuration.txt | 8 ++++++++ include/haproxy/http_ana-t.h | 1 + src/http_ana.c | 31 +++++++++++++++++++++++++++++++ src/http_rules.c | 5 ++++- 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index bca9974ae..9bd5d45ae 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -11461,6 +11461,14 @@ redirect scheme [code ]