Bug 61083 - mod_proxy_html ignoring ProxyHTMLCharsetOut
Summary: mod_proxy_html ignoring ProxyHTMLCharsetOut
Status: RESOLVED WORKSFORME
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_html (show other bugs)
Version: 2.4.25
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-10 10:09 UTC by Antonio Suárez
Modified: 2017-12-16 20:28 UTC (History)
0 users



Attachments
Apache 2.4.25 trace files with proxy-html enabled and disabled (4.78 KB, application/zip)
2017-05-10 10:09 UTC, Antonio Suárez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Suárez 2017-05-10 10:09:06 UTC
Created attachment 34990 [details]
Apache 2.4.25 trace files with proxy-html enabled and disabled

Hi,

We're upgrading a site from Apache 2.2 and just found that version 2.4 seems to ignore the ProxyHTMLCharsetOut directive. 

Our setup:
* Fronted: SSL site on Apache 2.4.25. Output charset should be ISO-8859-1
* Backend: non-SSL site on Tomcat 8.5.6. Output charset is ISO-8859-1

Whenever we set: 

SetOutputFilter        proxy-html
ProxyHTMLCharsetOut    ISO-8859-1

the output charset is always UTF-8; if SetOutputFilter is commented out, then the output charset is ISO-8859-1 as expected.

This used to work fine on version 2.2. Wrong behaviour was first found on Debian 8 builtin package (version 2.4.10), but it's also happening on version 2.4.25 (downloaded as source and built with debian/rules makefile).

We've tried playing with xml2EncDefault, ProxyHTMLMeta, AddDefaultCharset and even mod_charset_lite with no result.

Trace files (error.log) with mod-proxy enabled and disabled are attached.

Thank you in advance. Best regards,
Comment 1 Nick Kew 2017-12-16 20:28:13 UTC
I've just investigated this.

There is a buglet: a HEAD request will incorrectly show UTF-8.  However, a request that returns data works just fine for me.  I'm inclined to say WONTFIX, but now that you've pointed it out I'll add a note to the docs.

Your problem is configuration.  Instead of "SetOutputFilter", you need to use ProxyHTMLEnable On (and have mod_xml2enc loaded) to cause mod_proxy_html to configure i18n.  I think that highlights a docs bug, and I'm thinking about how to add that prominently.