Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 6, 2024
1 parent efb57a4 commit f0f25eb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/handler/cache-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,15 @@ class CacheHandler extends DecoratorHandler {
if (this.#writeStream) {
this.#writeStream.on('drain', resume)
this.#writeStream.on('error', () => {
// TODO (fix): Make this error somehow observable?
// TODO (fix): Make error somehow observable?
this.#writeStream = undefined
// TODO (fix): Should we resume even if was paused downstream?
resume()
})
}
}

if (typeof this.#handler.onHeaders === 'function') {
return downstreamOnHeaders()
}

return false
return downstreamOnHeaders()
}

/**
Expand Down Expand Up @@ -330,7 +327,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
Expand Down

0 comments on commit f0f25eb

Please sign in to comment.