Subject: Don't modify query string for other cgis
Origin: http://www.namazu.org/ml/namazu-win32-users-ja/msg01596.html
Author: Yoshinori Takesako <takesako @ xxxxxxxxxx>
Date: 2002-12-13
Bug-Debian: https://bugs.debian.org/176804
Forwarded: no (upstream is gone)
Comment: Reconstructed from changelog and other data

--- a/mod_encoding.c
+++ b/mod_encoding.c
@@ -185,13 +185,21 @@
   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)
+  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;
-  ap_parse_uri(r, buff);
+  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) */
