Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

check if headers has been already sent in image middleware #453

Merged
merged 3 commits into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve `_outputFormatter` on cache catalog-response to prevent exception - @cewald (#432)
- use ts for compiling additional scripts - @gibkigonzo (#437)
- Bugfix for wrong JSON scheme url's and hostname resolution for `magento1` platform - @cewald (#443)
- check if headers has been already sent in image middleware - @gibkigonzo (#434)

## [1.11.1] - 2020.03.17

Expand Down
4 changes: 4 additions & 0 deletions src/api/img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export default ({ config, db }) =>
imageBuffer = imageAction.imageBuffer
}

if (res.headersSent) {
return
}

return res
.type(imageAction.mimeType)
.set({ 'Cache-Control': `max-age=${imageAction.maxAgeForResponse}` })
Expand Down