]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* Do not add the query string again in the case that we are using the
authorRuediger Pluem <rpluem@apache.org>
Sat, 19 Apr 2008 18:48:05 +0000 (18:48 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 19 Apr 2008 18:48:05 +0000 (18:48 +0000)
  unparsed uri.

PR: 44803

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649840 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_ajp.c
modules/proxy/mod_proxy_http.c

index 16329e2523cd227f0ad46245ae06ac32e62e57f1..698ad5e9853240a412507de61dd1e6414e228be2 100644 (file)
@@ -31,7 +31,6 @@ 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() */
@@ -59,27 +58,17 @@ static int proxy_ajp_canon(request_rec *r, char *url)
 
     /*
      * now parse path/search args, according to rfc1738
-     *
-     * N.B. if this isn't a true proxy request, then the URL _path_
-     * has already been decoded.  True proxy requests have
-     * r->uri == r->unparsed_uri, and no others have that property.
      */
-    pnocanon = apr_table_get(r->notes, "proxy-nocanon");
-    if ((r->uri == r->unparsed_uri) ||  pnocanon) {
-        search = strchr(url, '?');
-        if (search != NULL)
-            *(search++) = '\0';
-    }
-    else
-        search = r->args;
+    search = NULL;
 
     /* process path */
-    if (pnocanon) {
+    if (apr_table_get(r->notes, "proxy-nocanon")) {
         path = url;   /* this is the raw path */
     }
     else {
         path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, 0,
                                  r->proxyreq);
+        search = r->args;
     }
     if (path == NULL)
         return HTTP_BAD_REQUEST;
index 89d893c5715426ff1618da839b3b52b50608dd6b..996a2e8210bb828594f098bd3b55197da8fca442 100644 (file)
@@ -36,7 +36,6 @@ 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() */
@@ -69,19 +68,7 @@ static int proxy_http_canon(request_rec *r, char *url)
     }
 
     /* now parse path/search args, according to rfc1738 */
-    /* N.B. if this isn't a true proxy request, then the URL _path_
-     * has already been decoded.  True proxy requests have r->uri
-     * == r->unparsed_uri, and no others have that property.
-     */
-    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';
-    }
-    else
-        search = r->args;
+    search = NULL;
 
     /* process path */
     /* In a reverse proxy, our URL has been processed, so canonicalise
@@ -91,12 +78,13 @@ static int proxy_http_canon(request_rec *r, char *url)
     switch (r->proxyreq) {
     default: /* wtf are we doing here? */
     case PROXYREQ_REVERSE:
-        if (pnocanon) {
+        if (apr_table_get(r->notes, "proxy-nocanon")) {
             path = url;   /* this is the raw path */
         }
         else {
             path = ap_proxy_canonenc(r->pool, url, strlen(url),
                                      enc_path, 0, r->proxyreq);
+            search = r->args;
         }
         break;
     case PROXYREQ_PROXY: