diff options
author | Joe Orton <jorton@apache.org> | 2020-12-16 17:23:23 +0100 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2020-12-16 17:23:23 +0100 |
commit | caeb9081648a92d2e545af5c97fd6fe5120eb4cf (patch) | |
tree | 5eed48a3e7a459e05e8970e716e6de6c34724a2a /modules/filters | |
parent | * Add missing line break [skip ci] (diff) | |
download | apache2-caeb9081648a92d2e545af5c97fd6fe5120eb4cf.tar.xz apache2-caeb9081648a92d2e545af5c97fd6fe5120eb4cf.zip |
The Microsoft OOXML format uses xml packaged into a zip file, and has
mimetypes like:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
This mimetypes contains 'xml', but is unfortunately not an xml file.
xml2enc processes these files (in particular, when mod_proxy_html is
used), typically resulting in them being corrupted as it seems to
attempt to perform a ISO-8859-1 to UTF-8 conversion on them.
* modules/filters/mod_xml2enc.c (xml2enc_ffunc): Restrict test for XML
types to matching "+xml".
Submitted by: Joseph Heenan <joseph.heenan fintechlabs.io>
PR: 64339
Github: closes #150
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884505 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/filters')
-rw-r--r-- | modules/filters/mod_xml2enc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c index d31348e844..34f8e8ee09 100644 --- a/modules/filters/mod_xml2enc.c +++ b/modules/filters/mod_xml2enc.c @@ -343,8 +343,8 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb) if (isupper(*p)) *p = tolower(*p); - /* only act if starts-with "text/" or contains "xml" */ - if (strncmp(ctype, "text/", 5) && !strstr(ctype, "xml")) { + /* only act if starts-with "text/" or contains "+xml" */ + if (strncmp(ctype, "text/", 5) && !strstr(ctype, "+xml")) { ap_remove_output_filter(f); return ap_pass_brigade(f->next, bb) ; } |