Fix leak when we see an html page with nonsense Content-Encoding.
This commit is contained in:
@@ -1584,6 +1584,16 @@ ModPagespeedMessagesDomains Allow localhost
|
||||
ModPagespeedEnableFilters debug
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost localhost:@@APACHE_SECONDARY_PORT@@>
|
||||
ServerName content-encoding.example.com
|
||||
DocumentRoot "@@APACHE_DOC_ROOT@@"
|
||||
ModPagespeedFileCachePath "@@MOD_PAGESPEED_CACHE@@"
|
||||
ModPagespeedRewriteLevel PassThrough
|
||||
ModPagespeedEnableFilters debug
|
||||
ModPagespeedSlurpDirectory @@APACHE_DOC_ROOT@@/mod_pagespeed_test/bogus_content_encoding/
|
||||
ModPagespeedSlurpReadOnly on
|
||||
</VirtualHost>
|
||||
|
||||
#STATS_LOGGING ModPagespeedStatistics on
|
||||
#STATS_LOGGING ModPagespeedStatisticsLogging on
|
||||
#STATS_LOGGING ModPagespeedLogDir "@@MOD_PAGESPEED_LOG@@"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
HTTP/1.1 200 OK
|
||||
Content-Encoding: nonsense
|
||||
Content-Length: 0
|
||||
Content-Type: text/html
|
||||
|
||||
@@ -496,9 +496,12 @@ InstawebContext* build_context_for_request(request_rec* request) {
|
||||
// We don't know the encoding, so we cannot rewrite the HTML.
|
||||
const char* encoding = apr_table_get(request->headers_out,
|
||||
HttpAttributes::kContentEncoding);
|
||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, request,
|
||||
ap_log_rerror(APLOG_MARK, APLOG_INFO, APR_SUCCESS, request,
|
||||
"Request not rewritten because: Content-Encoding is "
|
||||
"unsupported (was %s)", encoding);
|
||||
// We need to cleanup the rewrite driver; the pool will clean up the
|
||||
// context object.
|
||||
context->Finish();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ if [ "$SECONDARY_HOSTNAME" != "" ]; then
|
||||
run_test pass_through_headers
|
||||
run_test purging_disabled
|
||||
run_test inline_google_font_css
|
||||
run_test content_encoding_leak
|
||||
fi
|
||||
|
||||
run_test proxying
|
||||
|
||||
Reference in New Issue
Block a user