You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2025/04/16 11:29:26 UTC

svn commit: r1925109 - in /httpd/httpd/trunk: changes-entries/pr69443.txt modules/proxy/mod_proxy_balancer.c

Author: rpluem
Date: Wed Apr 16 11:29:25 2025
New Revision: 1925109

URL: http://svn.apache.org/viewvc?rev=1925109&view=rev
Log:
* Temporarily add back the query string to the URL as it might contain the
  routing information for sticky sessions.

PR: 69443

Added:
    httpd/httpd/trunk/changes-entries/pr69443.txt   (with props)
Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c

Added: httpd/httpd/trunk/changes-entries/pr69443.txt
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/changes-entries/pr69443.txt?rev=1925109&view=auto
==============================================================================
--- httpd/httpd/trunk/changes-entries/pr69443.txt (added)
+++ httpd/httpd/trunk/changes-entries/pr69443.txt Wed Apr 16 11:29:25 2025
@@ -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]

Propchange: httpd/httpd/trunk/changes-entries/pr69443.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=1925109&r1=1925108&r2=1925109&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Wed Apr 16 11:29:25 2025
@@ -274,11 +274,23 @@ static proxy_worker *find_session_route(
                                         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",