From 2887e5248e6abfbff6b370088400b201c3c7317a Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Thu, 16 Feb 2017 07:35:01 +0100 Subject: [PATCH] Clean the response headers when sending kNotInCache When we send out a 501 in the IPRO path for a http cache hit, clear the response headers so we do not leave behind stray headers. Fixes https://github.com/pagespeed/mod_pagespeed/issues/1496 --- net/instaweb/rewriter/in_place_rewrite_context.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/net/instaweb/rewriter/in_place_rewrite_context.cc b/net/instaweb/rewriter/in_place_rewrite_context.cc index ad2076a0a4..8f8d625cf1 100644 --- a/net/instaweb/rewriter/in_place_rewrite_context.cc +++ b/net/instaweb/rewriter/in_place_rewrite_context.cc @@ -139,6 +139,7 @@ void RecordingFetch::HandleHeadersComplete() { // kNotInCacheStatus instead to fall back to the server's native method of // serving the url and indicate we do want it recorded. if (!response_headers()->IsErrorStatus()) { + response_headers()->Clear(); response_headers()->set_status_code( CacheUrlAsyncFetcher::kNotInCacheStatus); }