diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 7213660d0f..16329e2523 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -31,6 +31,7 @@ static int proxy_ajp_canon(request_rec *r, char *url) { char *host, *path, *search, sport[7]; const char *err; + const char *pnocanon; apr_port_t port = AJP13_DEF_PORT; /* ap_port_of_scheme() */ @@ -63,7 +64,8 @@ static int proxy_ajp_canon(request_rec *r, char *url) * has already been decoded. True proxy requests have * r->uri == r->unparsed_uri, and no others have that property. */ - if (r->uri == r->unparsed_uri) { + pnocanon = apr_table_get(r->notes, "proxy-nocanon"); + if ((r->uri == r->unparsed_uri) || pnocanon) { search = strchr(url, '?'); if (search != NULL) *(search++) = '\0'; @@ -72,7 +74,7 @@ static int proxy_ajp_canon(request_rec *r, char *url) search = r->args; /* process path */ - if (apr_table_get(r->notes, "proxy-nocanon")) { + if (pnocanon) { path = url; /* this is the raw path */ } else { diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 0d21358fdb..89d893c571 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -36,6 +36,7 @@ static int proxy_http_canon(request_rec *r, char *url) char *host, *path, *search, sport[7]; const char *err; const char *scheme; + const char *pnocanon; apr_port_t port, def_port; /* ap_port_of_scheme() */ @@ -72,7 +73,9 @@ static int proxy_http_canon(request_rec *r, char *url) * has already been decoded. True proxy requests have r->uri * == r->unparsed_uri, and no others have that property. */ - if (r->uri == r->unparsed_uri) { + pnocanon = apr_table_get(r->notes, "proxy-nocanon"); + if ((r->uri == r->unparsed_uri) || + ((r->proxyreq == PROXYREQ_REVERSE) && pnocanon)) { search = strchr(url, '?'); if (search != NULL) *(search++) = '\0'; @@ -88,7 +91,7 @@ static int proxy_http_canon(request_rec *r, char *url) switch (r->proxyreq) { default: /* wtf are we doing here? */ case PROXYREQ_REVERSE: - if (apr_table_get(r->notes, "proxy-nocanon")) { + if (pnocanon) { path = url; /* this is the raw path */ } else {