From: Jeff Trawick Date: Sun, 11 Nov 2007 14:32:58 +0000 (+0000) Subject: Re-work the explanation in commentary and debug logging of X-Git-Tag: 2.3.0~1277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d15e52b54411acc2589aa5ec588bed87cd129d8d;p=apache Re-work the explanation in commentary and debug logging of when modules and scripts may be harmed by transformation of the request body. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@593890 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_charset_lite.c b/modules/filters/mod_charset_lite.c index 903b392375..1489e4316c 100644 --- a/modules/filters/mod_charset_lite.c +++ b/modules/filters/mod_charset_lite.c @@ -1060,15 +1060,21 @@ static int xlate_in_filter(ap_filter_t *f, apr_bucket_brigade *bb, if (!ctx->ran) { /* filter never ran before */ chk_filter_chain(f); ctx->ran = 1; - if (!ctx->noop && !ctx->is_sb) { - /* We're not converting between two single-byte charsets, so note - * that some handlers can't deal with it. - * It doesn't help to unset Content-Length in the input header - * table since in all likelihood the handler has already seen it. + if (!ctx->noop && !ctx->is_sb + && apr_table_get(f->r->headers_in, "Content-Length")) { + /* A Content-Length header is present, but it won't be valid after + * conversion because we're not converting between two single-byte + * charsets. This will affect most CGI scripts and may affect + * some modules. + * Content-Length can't be unset here because that would break + * being able to read the request body. + * Processing of chunked request bodies is not impacted by this + * filter since the the length was not declared anyway. */ if (dc->debug >= DBGLVL_PMC) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, - "Request body length may change, breaking some requests"); + "Request body length may change, resulting in " + "misprocessing by some modules or scripts"); } } }