diff --git a/lib/handler/cache-handler.js b/lib/handler/cache-handler.js index e4b361693ab..b86239c5da3 100644 --- a/lib/handler/cache-handler.js +++ b/lib/handler/cache-handler.js @@ -145,11 +145,7 @@ class CacheHandler extends DecoratorHandler { } } - if (typeof this.#handler.onHeaders === 'function') { - return downstreamOnHeaders() - } - - return false + return downstreamOnHeaders() } /** @@ -330,7 +326,7 @@ function stripNecessaryHeaders (rawHeaders, parsedHeaders, cacheControlDirective for (let i = 0; i < headerNames.length; i++) { const header = headerNames[i] - if (headersToRemove.indexOf(header) !== -1) { + if (headersToRemove.includes(header)) { // We have a at least one header we want to remove if (!strippedHeaders) { // This is the first header we want to remove, let's create the object