]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1925109 from trunk:
authorRuediger Pluem <rpluem@apache.org>
Wed, 4 Jun 2025 07:36:11 +0000 (07:36 +0000)
committerRuediger Pluem <rpluem@apache.org>
Wed, 4 Jun 2025 07:36:11 +0000 (07:36 +0000)
* Temporarily add back the query string to the URL as it might contain the
  routing information for sticky sessions.

PR: 69443

Reviewed by: rpluem, covener, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1926107 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/STATUS b/STATUS
index 003d8f93ccb299a815dfcff04aa8662a726a789d..7288e1499b24d0a9d6cf7d484232afcb79530f17 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -183,16 +183,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
         https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/533.diff
      +1 covener, rpluem, jorton
 
-  *) 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
-     Trunk version of patch:
-        https://svn.apache.org/r1925109
-     Backport version for 2.4.x of patch:
-      Trunk version of patch works
-      svn merge -c 1925109 ^/httpd/httpd/trunk .
-     +1: rpluem, covener, ylavic
-
   *) mod_systemd: Add systemd socket activation
      Trunk version of patch:
         https://svn.apache.org/r1511033
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 140366e6d528d021c8c9b677b28e259265590faf..daec21ad6c3cec175e25f12f83ac8d9e40ca78fe 100644 (file)
@@ -276,11 +276,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",