diff options
author | Nick Kew <niq@apache.org> | 2007-08-14 11:22:15 +0200 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2007-08-14 11:22:15 +0200 |
commit | 57104f62f05cdefda4e4a0650a3e7886c7a37b37 (patch) | |
tree | bfedb9b2967fd48c7306cc37847c8eaa59e5773c /modules/mappers | |
parent | Complete the various flags. I'd like to see more examples here, and (diff) | |
download | apache2-57104f62f05cdefda4e4a0650a3e7886c7a37b37.tar.xz apache2-57104f62f05cdefda4e4a0650a3e7886c7a37b37.zip |
mod_negotiation: preserve Query String in resolving a type map
PR 33112. Report with patch by Jørgen Thomsen.
Attention called to it by Per Jessen.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@565671 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/mappers')
-rw-r--r-- | modules/mappers/mod_negotiation.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index 3759278b75..3a89dc3f9c 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -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; @@ -3061,8 +3062,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; } |