summaryrefslogtreecommitdiffstats
path: root/core/modules/image/src/Controller/ImageStyleDownloadController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/image/src/Controller/ImageStyleDownloadController.php')
-rw-r--r--core/modules/image/src/Controller/ImageStyleDownloadController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/image/src/Controller/ImageStyleDownloadController.php b/core/modules/image/src/Controller/ImageStyleDownloadController.php
index 2cc6585..1407298 100644
--- a/core/modules/image/src/Controller/ImageStyleDownloadController.php
+++ b/core/modules/image/src/Controller/ImageStyleDownloadController.php
@@ -178,7 +178,11 @@ class ImageStyleDownloadController extends FileDownloadController {
'Content-Type' => $image->getMimeType(),
'Content-Length' => $image->getFileSize(),
);
- return new BinaryFileResponse($uri, 200, $headers);
+ // \Drupal\Core\EventSubscriber\FinishResponseSubscriber::onRespond()
+ // sets response as not cacheable if the Cache-Control header is not
+ // already modified. We pass in FALSE for non-private schemes for the
+ // $public parameter to make sure we don't change the headers.
+ return new BinaryFileResponse($uri, 200, $headers, $scheme !== 'private');
}
else {
$this->logger->notice('Unable to generate the derived image located at %path.', array('%path' => $derivative_uri));