Created attachment 31408 [details] Let mod_proxy_html keep the doctype and fix empty tag ending in XHTML documents Currently mod_proxy_html removes any <!doctype> tags from the beginning of HTML and XHTML documents. This <!doctype> tag is needed by some browsers to correctly render XHTML documents. Additionally mod_proxy_html doesn't terminate empty tags in XHTML documents correctly unless "ProxyHTMLDoctype XHTML" is explicitly configured. So, unless you have ProxyHTMLDoctype configured correctly, XHTML documents are invalid after passing mod_proxy_html. The attached patch fixes the first issue by using the internalSubset hook of the libxml2 SAX parser to parse and output the <!doctype> tag. To address the second issue, the same hook is used to automatically detect whether the current document is an XHTML document or not. In case of an XHTML document the XHTML-style for closing empty tags is enabled for the current request. In my opinion the suggested patch makes the directive ProxyHTMLDoctype more or less obsolete. Of course it is kept for backwards compatibility. The patch is based on httpd trunk, rev. 1579365.
You mean automatic doctype detection? Dammit, thought I'd done something more-or-less equivalent years ago, but I guess that must've been in another module. Will check your patch - thanks.
I've adapted your patch a little, and made "auto" a configuration option. Committed in r1599027 . Thanks for the patch.