summaryrefslogtreecommitdiffstats
path: root/modules/http/mod_mime.c
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2023-02-07 15:20:37 +0100
committerRuediger Pluem <rpluem@apache.org>2023-02-07 15:20:37 +0100
commitc23375e9455ed158f3e032477db9da41c5e5f04a (patch)
tree49036cfe2fb43ceb41fc25e500f2670ffe0e258d /modules/http/mod_mime.c
parentfr doc rebuild. (diff)
downloadapache2-c23375e9455ed158f3e032477db9da41c5e5f04a.tar.xz
apache2-c23375e9455ed158f3e032477db9da41c5e5f04a.zip
* In the reverse proxy case r->filename might contain a query string if
the nocanon option was used with ProxyPass. If this is the case cut off the query string as the last parameter in this query string might end up on an extension we take care about, but we only want to match against path components not against query parameters. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907505 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--modules/http/mod_mime.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c
index 3cf907148c..13d2589456 100644
--- a/modules/http/mod_mime.c
+++ b/modules/http/mod_mime.c
@@ -813,7 +813,7 @@ static int find_ct(request_rec *r)
mime_dir_config *conf;
apr_array_header_t *exception_list;
char *ext;
- const char *fn, *fntmp, *type, *charset = NULL, *resource_name;
+ const char *fn, *fntmp, *type, *charset = NULL, *resource_name, *qm;
int found_metadata = 0;
if (r->finfo.filetype == APR_DIR) {
@@ -837,6 +837,19 @@ static int find_ct(request_rec *r)
if (conf->use_path_info & 1) {
resource_name = apr_pstrcat(r->pool, r->filename, r->path_info, NULL);
}
+ /*
+ * In the reverse proxy case r->filename might contain a query string if
+ * the nocanon option was used with ProxyPass.
+ * If this is the case cut off the query string as the last parameter in
+ * this query string might end up on an extension we take care about, but
+ * we only want to match against path components not against query
+ * parameters.
+ */
+ else if ((r->proxyreq == PROXYREQ_REVERSE)
+ && (apr_table_get(r->notes, "proxy-nocanon"))
+ && ((qm = ap_strchr_c(r->filename, '?')) != NULL)) {
+ resource_name = apr_pstrmemdup(r->pool, r->filename, qm - r->filename);
+ }
else {
resource_name = r->filename;
}