-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mod_proxy_html: skip documents shorter than 4 bytes
+ PR 56286 [Micha Lenk <micha lenk info>]
+
*) mod_proxy_fdpass: Fix computation of the size of 'struct sockaddr_un'
when passed to 'connec()'.
[Graham Dumpleton <grahamd apache org>]
else if (apr_bucket_read(b, &buf, &bytes, APR_BLOCK_READ)
== APR_SUCCESS) {
if (ctxt->parser == NULL) {
+ /* For documents smaller than four bytes, there is no reason to do
+ * HTML rewriting. The URL schema (i.e. 'http') needs four bytes alone.
+ * And the HTML parser needs at least four bytes to initialise correctly.
+ */
+ if ((bytes < 4) && APR_BUCKET_IS_EOS(APR_BUCKET_NEXT(b))) {
+ ap_remove_output_filter(f) ;
+ return ap_pass_brigade(f->next, bb) ;
+ }
+
const char *cenc;
if (!xml2enc_charset ||
(xml2enc_charset(f->r, &enc, &cenc) != APR_SUCCESS)) {