]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backport PR: 33112
authorJim Jagielski <jim@apache.org>
Tue, 28 Aug 2007 14:57:44 +0000 (14:57 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 28 Aug 2007 14:57:44 +0000 (14:57 +0000)
Merge r565671 from trunk:

mod_negotiation: preserve Query String in resolving a type map
PR 33112.  Report with patch by J?\195?\184rgen Thomsen.
Attention called to it by Per Jessen.

Submitted by: niq
Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@570450 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/mappers/mod_negotiation.c

diff --git a/CHANGES b/CHANGES
index 94f362cc053346f96b908e1ba67f2d50d04781af..7bc4fb94b738c409a54b53e552eab7750c3193eb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.6
 
+  *) mod_negotiation: preserve Query String in resolving a type map
+     PR 33112 [Jørgen Thomsen <apache jth.net>, Nick Kew]
+
   *) mod_ssl: Version reporting update; displays 'compiled against'
      Apache and build-time SSL Library versions at loglevel [info],
      while reporting the run-time SSL Library version in the server
diff --git a/STATUS b/STATUS
index e7243709ed4b3699f7152f0718d212dd5dc45002..a056e18896b6abd27df8459b82c6d199dfb59411 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,11 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * mod_negotiation: Preserve Query String when resolving a type map
-      PR: 33112
-      http://svn.apache.org/viewvc?view=rev&revision=565671
-      +1: niq, wrowe, rpluem
-
     * log core: ensure we use a special pool for stderr logging, so that
       the stderr channel remains valid from the time plog is destroyed,
       until the time the open_logs hook is called again.  [William Rowe]
index 8c54fa72ca96db6215fcf7bb3c31c16ea3fae0c4..c9fff1e5e5443c7de6bbfff6ea7bed6a226baffb 100644 (file)
@@ -2971,6 +2971,7 @@ static int handle_map_file(request_rec *r)
     var_rec *best;
     int res;
     char *udir;
+    const char *new_req;
 
     if(strcmp(r->handler,MAP_FILE_MAGIC_TYPE) && strcmp(r->handler,"type-map"))
         return DECLINED;
@@ -3062,8 +3063,21 @@ static int handle_map_file(request_rec *r)
     }
     udir = ap_make_dirstr_parent(r->pool, r->uri);
     udir = ap_escape_uri(r->pool, udir);
-    ap_internal_redirect(apr_pstrcat(r->pool, udir, best->file_name,
-                                     r->path_info, NULL), r);
+    if (r->args) {
+        if (r->path_info) {
+            new_req = apr_pstrcat(r->pool, udir, best->file_name,
+                                  r->path_info, "?", r->args, NULL);
+        }
+        else {
+            new_req = apr_pstrcat(r->pool, udir, best->file_name,
+                                  "?", r->args, NULL);
+        }
+    }
+    else {
+        new_req = apr_pstrcat(r->pool, udir, best->file_name,
+                              r->path_info, NULL);
+    }
+    ap_internal_redirect(new_req, r);
     return OK;
 }