--- mod_encoding.c.orig Wed Jun 16 00:52:25 2004 +++ mod_encoding.c Wed Dec 7 12:34:17 2005 @@ -74,7 +74,9 @@ #include #include #include -/* #include */ +#include +#include +#include #include @@ -185,13 +187,20 @@ char *buff; char *keys[] = { "Destination", NULL }; int i; + char *unparsed_uri; + char *query_string; /* Normalize encoding in HTTP request line */ - ap_unescape_url(r->unparsed_uri); - if ((buff = iconv_string(r, cd, r->unparsed_uri, - strlen(r->unparsed_uri))) == NULL) - return -1; - ap_parse_uri(r, buff); + query_string = apr_pstrdup(r->pool, r->unparsed_uri); + unparsed_uri = ap_getword(r->pool, &query_string, '?'); + ap_unescape_url(unparsed_uri); + if ((buff = iconv_string(r, cd, unparsed_uri, strlen(unparsed_uri))) == NULL) + return -1; + if (query_string && strlen(query_string) > 0) { + ap_parse_uri(r, apr_pstrcat(r->pool, buff, "?", query_string, NULL)); + } else { + ap_parse_uri(r, buff); + } ap_getparents(r->uri); /* normalize given path for security */ /* Normalize encoding in HTTP request header(s) */