From: Ruediger Pluem Date: Wed, 4 Jun 2025 07:36:11 +0000 (+0000) Subject: Merge r1925109 from trunk: X-Git-Tag: 2.4.64-rc1-candidate~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82a9e886f42db063fb87c2973b33a88320ae65b;p=thirdparty%2Fapache%2Fhttpd.git Merge r1925109 from trunk: * 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 --- diff --git a/STATUS b/STATUS index 003d8f93cc..7288e1499b 100644 --- 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 index 0000000000..97de769393 --- /dev/null +++ b/changes-entries/pr69443.txt @@ -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] diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 140366e6d5..daec21ad6c 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -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",