Skip to content

Commit e362378

Browse files
committed
* Temporarily add back the query string to the URL as it might contain the
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
1 parent 65d5f9e commit e362378

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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
@@ -274,11 +274,23 @@ static proxy_worker *find_session_route(proxy_balancer *balancer,
274274
char **url)
275275
{
276276
proxy_worker *worker = NULL;
277+
char *url_with_qs;
277278

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

0 commit comments

Comments
 (0)