Repository navigation
mod_proxy_html: URL map regex fixes, ProxyHTMLMaxBufSize, DocType with libxml2 2.14 - #1104
Merged
Merged
Conversation
* modules/filters/mod_proxy_html.c (comp_urlmap): Set regflags for interpolated rules too, and fail if the regex does not compile. (fixup_rules): Skip a rule whose interpolated regex does not compile; only evaluate conditions and interpolate with ProxyHTMLInterp on. (has_request_regex): New function. (check_filter_init): Use fixup_rules() for an interpolated regex without ProxyHTMLInterp. * test/modules/filters/test_011_proxy_html_urlmap.py: New test. * test/modules/filters/env.py (FiltersTestSetup.__init__): Load mod_xml2enc and mod_proxy_html if available. (FiltersTestEnv.__init__): Log mod_proxy_html at debug level. (FiltersTestEnv.configtest): New method. * changes-entries/proxy-html-urlmap-regex.txt: Add. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* modules/filters/mod_proxy_html.c (buffer_text): New function. (pcdata, pcomment): Use it. (pendElement, pstartElement): Reset overflow state. (set_maxbufsz): New function. (proxy_html_config, proxy_html_merge, proxy_html_cmds): Add ProxyHTMLMaxBufSize, defaulting to 1M. * docs/manual/mod/mod_proxy_html.xml: Document ProxyHTMLMaxBufSize. * test/modules/filters/test_012_proxy_html_maxbuf.py: New test. * changes-entries/proxy-html-maxbufsize.txt: Add. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* modules/filters/mod_proxy_html.c (PROXY_HTML_ENFORCE): Define for libxml2 < 2.14. (fpi_html, fpi_html_legacy, fpi_xhtml, fpi_xhtml_legacy): Define only with PROXY_HTML_ENFORCE. (empty_elts, is_empty_elt): New, used without PROXY_HTML_ENFORCE. (pendElement, pstartElement): Compile element and attribute enforcement, and use htmlTagLookup(), only with PROXY_HTML_ENFORCE; drop the pragmas ignoring deprecated declarations. (set_doctype): Fail for the HTML and XHTML forms otherwise. * docs/manual/mod/mod_proxy_html.xml: Document the restriction on ProxyHTMLDocType. * test/modules/filters/test_013_proxy_html_doctype.py: New test. * test/pytest_suite/t/conf/proxy.conf.in: Use the HTML5 form of ProxyHTMLDocType. * changes-entries/proxy-html-doctype-libxml2.txt: Add. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
notroj
added a commit
to apache/httpd-tests
that referenced
this pull request
Nov 27, 2026
"ProxyHTMLDocType HTML" is refused by an httpd built with libxml2 2.14 or later (apache/httpd#1104), so the server did not start. The test only checks that a doctype is added. * t/conf/proxy.conf.in: Use "ProxyHTMLDocType HTML5". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
notroj
force-pushed
the
mod_proxy_html-fixes
branch
from
November 27, 2026 16:12
ce39709 to
53f3cf2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three independent
mod_proxy_htmlchanges, one commit each:ProxyHTMLURLMapregex which does not compile is now a configuration error, or for an interpolated (v) pattern is logged and the rule skipped for that request, instead of crashing the child. The regex flags now apply to interpolated rules, and anRvrule withoutProxyHTMLInterpis compiled as written.ProxyHTMLMaxBufSizedirective (default1M,0for no limit) bounding the text buffered for rewriting withProxyHTMLExtended. A larger script, stylesheet or comment is passed through unmodified and a warning logged.ProxyHTMLDocType HTML|XHTML [Legacy]is rejected when built with libxml2 2.14 or later, wherehtmlAttrAllowed()is a stub and the attribute tables are gone, and the enforcement code is compiled out. TheHTML5,autoand custom FPI forms are unaffected.The libxml2 check is at compile time only. I could not build against libxml2 >= 2.14 locally, so that path was only exercised by forcing the
#if.The
metafix()over-read is left to #783.🤖 Generated with Claude Code