diff options
author | Ruediger Pluem <rpluem@apache.org> | 2024-07-02 13:19:45 +0200 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2024-07-02 13:19:45 +0200 |
commit | fbe782e6c4a7c255790b80c74d5b8ee320ec93d2 (patch) | |
tree | a4f720119beaa2f7c2815e451d99e2881ea7cdf1 | |
parent | * Follow up to r1918814: Always trust content types that we set literally (diff) | |
download | apache2-fbe782e6c4a7c255790b80c74d5b8ee320ec93d2.tar.xz apache2-fbe782e6c4a7c255790b80c74d5b8ee320ec93d2.zip |
* Follow up to r1918814: Strings are from configuration and thus trusted
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918823 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/filters/mod_ext_filter.c | 2 | ||||
-rw-r--r-- | modules/generators/mod_autoindex.c | 6 | ||||
-rw-r--r-- | modules/http/byterange_filter.c | 4 | ||||
-rw-r--r-- | modules/http/http_request.c | 2 | ||||
-rw-r--r-- | modules/proxy/mod_proxy_ftp.c | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index 0d2ae72b57..b479d52230 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -610,7 +610,7 @@ static apr_status_t init_filter_instance(ap_filter_t *f) } if (ctx->filter->outtype && ctx->filter->outtype != OUTTYPE_UNCHANGED) { - ap_set_content_type(f->r, ctx->filter->outtype); + ap_set_content_type_ex(f->r, ctx->filter->outtype, 1); } if (ctx->filter->preserves_content_length != 1) { /* nasty, but needed to avoid confusing the browser diff --git a/modules/generators/mod_autoindex.c b/modules/generators/mod_autoindex.c index f1c08b4b12..3cafd44b0c 100644 --- a/modules/generators/mod_autoindex.c +++ b/modules/generators/mod_autoindex.c @@ -2060,11 +2060,11 @@ static int index_directory(request_rec *r, #endif } if (*charset) { - ap_set_content_type(r, apr_pstrcat(r->pool, ctype, ";charset=", - charset, NULL)); + ap_set_content_type_ex(r, apr_pstrcat(r->pool, ctype, ";charset=", + charset, NULL), 1); } else { - ap_set_content_type(r, ctype); + ap_set_content_type_ex(r, ctype, 1); } if (autoindex_opts & TRACK_MODIFIED) { diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c index 8c5a670c6c..6fdc665887 100644 --- a/modules/http/byterange_filter.c +++ b/modules/http/byterange_filter.c @@ -473,9 +473,9 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f, /* Is ap_make_content_type required here? */ const char *orig_ct = ap_make_content_type(r, r->content_type); - ap_set_content_type(r, apr_pstrcat(r->pool, + ap_set_content_type_ex(r, apr_pstrcat(r->pool, "multipart/byteranges; boundary=", - ap_multipart_boundary, NULL)); + ap_multipart_boundary, NULL), 1); if (orig_ct) { bound_head = apr_pstrcat(r->pool, diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 24d6b66706..65c389125a 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -805,7 +805,7 @@ AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec * } if (r->handler) - ap_set_content_type(new, r->content_type); + ap_set_content_type_ex(new, r->content_type, AP_REQUEST_IS_TRUSTED_CT(r)); access_status = ap_process_request_internal(new); if (access_status == OK) { access_status = ap_invoke_handler(new); diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c index 118a9d1a88..f33360efa5 100644 --- a/modules/proxy/mod_proxy_ftp.c +++ b/modules/proxy/mod_proxy_ftp.c @@ -1878,10 +1878,10 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, /* set content-type */ if (dirlisting) { - ap_set_content_type(r, apr_pstrcat(p, "text/html;charset=", + ap_set_content_type_ex(r, apr_pstrcat(p, "text/html;charset=", fdconf->ftp_directory_charset ? fdconf->ftp_directory_charset : - "ISO-8859-1", NULL)); + "ISO-8859-1", NULL), 1); } else { if (xfer_type != 'A' && size != NULL) { |