]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Temporarily add back the query string to the URL as it might contain the
authorRuediger Pluem <rpluem@apache.org>
Wed, 16 Apr 2025 11:29:25 +0000 (11:29 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 16 Apr 2025 11:29:25 +0000 (11:29 +0000)
  routing information for sticky sessions.

PR: 69443

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925109 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/pr69443.txt [new file with mode: 0644]
modules/proxy/mod_proxy_balancer.c

diff --git a/changes-entries/pr69443.txt b/changes-entries/pr69443.txt
new file mode 100644 (file)
index 0000000..97de769
--- /dev/null
@@ -0,0 +1,3 @@
+  *) mod_proxy_balancer: Fix a regression that caused stickysession keys no
+     longer be recognized if they are provided as query parameter in the URL.
+     PR 69443 [Ruediger Pluem]
index 984c61f016e3012e5042b7c301a6bdc9a27092cf..4fc2024b90171eeda56ada52da6df1571051e778 100644 (file)
@@ -274,11 +274,23 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
                                         char **url)
 {
     proxy_worker *worker = NULL;
+    char *url_with_qs;
 
     if (!*balancer->s->sticky)
         return NULL;
+    /*
+     * The route might be contained in the query string and *url is not
+     * supposed to contain the query string. Hence add it temporarily if
+     * present.
+     */
+    if (r->args) {
+        url_with_qs = apr_pstrcat(r->pool, *url, "?", r->args, NULL);
+    }
+    else {
+        url_with_qs = *url;
+    }
     /* Try to find the sticky route inside url */
-    *route = get_path_param(r->pool, *url, balancer->s->sticky_path, balancer->s->scolonsep);
+    *route = get_path_param(r->pool, url_with_qs, balancer->s->sticky_path, balancer->s->scolonsep);
     if (*route) {
         ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01159)
                      "Found value %s for stickysession %s",