1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

handle ? in cases where nocanon is in effect

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Jagielski
2008-04-17 19:20:16 +00:00
parent e1ae2aa551
commit aa2cf4597d
2 changed files with 9 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ static int proxy_ajp_canon(request_rec *r, char *url)
{ {
char *host, *path, *search, sport[7]; char *host, *path, *search, sport[7];
const char *err; const char *err;
const char *pnocanon;
apr_port_t port = AJP13_DEF_PORT; apr_port_t port = AJP13_DEF_PORT;
/* ap_port_of_scheme() */ /* 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 * has already been decoded. True proxy requests have
* r->uri == r->unparsed_uri, and no others have that property. * 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, '?'); search = strchr(url, '?');
if (search != NULL) if (search != NULL)
*(search++) = '\0'; *(search++) = '\0';
@@ -72,7 +74,7 @@ static int proxy_ajp_canon(request_rec *r, char *url)
search = r->args; search = r->args;
/* process path */ /* process path */
if (apr_table_get(r->notes, "proxy-nocanon")) { if (pnocanon) {
path = url; /* this is the raw path */ path = url; /* this is the raw path */
} }
else { else {

View File

@@ -36,6 +36,7 @@ static int proxy_http_canon(request_rec *r, char *url)
char *host, *path, *search, sport[7]; char *host, *path, *search, sport[7];
const char *err; const char *err;
const char *scheme; const char *scheme;
const char *pnocanon;
apr_port_t port, def_port; apr_port_t port, def_port;
/* ap_port_of_scheme() */ /* 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 * has already been decoded. True proxy requests have r->uri
* == r->unparsed_uri, and no others have that property. * == 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, '?'); search = strchr(url, '?');
if (search != NULL) if (search != NULL)
*(search++) = '\0'; *(search++) = '\0';
@@ -88,7 +91,7 @@ static int proxy_http_canon(request_rec *r, char *url)
switch (r->proxyreq) { switch (r->proxyreq) {
default: /* wtf are we doing here? */ default: /* wtf are we doing here? */
case PROXYREQ_REVERSE: case PROXYREQ_REVERSE:
if (apr_table_get(r->notes, "proxy-nocanon")) { if (pnocanon) {
path = url; /* this is the raw path */ path = url; /* this is the raw path */
} }
else { else {