On 04/17/2008 09:20 PM, [EMAIL PROTECTED] wrote:
Author: jim
Date: Thu Apr 17 12:20:16 2008
New Revision: 649239
URL: http://svn.apache.org/viewvc?rev=649239&view=rev
Log:
handle ? in cases where nocanon is in effect
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=649239&r1=649238&r2=649239&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Thu Apr 17 12:20:16 2008
@@ -31,6 +31,7 @@
{
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 @@
* 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 @@
search = r->args;
/* process path */
- if (apr_table_get(r->notes, "proxy-nocanon")) {
+ if (pnocanon) {
path = url; /* this is the raw path */
}
else {
I am frankly open here: The old code already looked ugly in respect of this and
the new code IMHO even looks uglier. What about the following patch which is
IMHO much
cleaner:
Index: modules/proxy/mod_proxy_ajp.c
===================================================================
--- modules/proxy/mod_proxy_ajp.c (Revision 649232)
+++ modules/proxy/mod_proxy_ajp.c (Arbeitskopie)
@@ -58,18 +58,8 @@
/*
* 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.
*/
- if (r->uri == r->unparsed_uri) {
- search = strchr(url, '?');
- if (search != NULL)
- *(search++) = '\0';
- }
- else
- search = r->args;
+ search = NULL;
/* process path */
if (apr_table_get(r->notes, "proxy-nocanon")) {
@@ -78,6 +68,7 @@
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;