Skip to content

Commit f82a9e8

Browse files
committed
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
1 parent 2b9eec4 commit f82a9e8

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

STATUS

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
183183
https://patch-diff.githubusercontent.com/raw/apache/httpd/pull/533.diff
184184
+1 covener, rpluem, jorton
185185

186-
*) mod_proxy_balancer: Fix a regression that caused stickysession keys no
187-
longer be recognized if they are provided as query parameter in the URL.
188-
PR 69443
189-
Trunk version of patch:
190-
https://svn.apache.org/r1925109
191-
Backport version for 2.4.x of patch:
192-
Trunk version of patch works
193-
svn merge -c 1925109 ^/httpd/httpd/trunk .
194-
+1: rpluem, covener, ylavic
195-
196186
*) mod_systemd: Add systemd socket activation
197187
Trunk version of patch:
198188
https://svn.apache.org/r1511033

changes-entries/pr69443.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*) mod_proxy_balancer: Fix a regression that caused stickysession keys no
2+
longer be recognized if they are provided as query parameter in the URL.
3+
PR 69443 [Ruediger Pluem]

modules/proxy/mod_proxy_balancer.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,23 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
276276
char **url)
277277
{
278278
proxy_worker *worker = NULL;
279+
char *url_with_qs;
279280

280281
if (!*balancer->s->sticky)
281282
return NULL;
283+
/*
284+
* The route might be contained in the query string and *url is not
285+
* supposed to contain the query string. Hence add it temporarily if
286+
* present.
287+
*/
288+
if (r->args) {
289+
url_with_qs = apr_pstrcat(r->pool, *url, "?", r->args, NULL);
290+
}
291+
else {
292+
url_with_qs = *url;
293+
}
282294
/* Try to find the sticky route inside url */
283-
*route = get_path_param(r->pool, *url, balancer->s->sticky_path, balancer->s->scolonsep);
295+
*route = get_path_param(r->pool, url_with_qs, balancer->s->sticky_path, balancer->s->scolonsep);
284296
if (*route) {
285297
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01159)
286298
"Found value %s for stickysession %s",

0 commit comments

Comments
 (0)