summaryrefslogtreecommitdiffstats
path: root/core/modules/system/src/FileDownloadController.php
diff options
context:
space:
mode:
authoreffulgentsia2015-10-05 22:09:09 (GMT)
committereffulgentsia2015-10-05 22:09:09 (GMT)
commit866be5fb95ab375c10d2e9884d628b44ac228296 (patch)
tree8fba56e0c33d46a5da232ce3bf3d249f506fcc2a /core/modules/system/src/FileDownloadController.php
parentd5c827e43c567c771c4d91aa0afda87bdbebf670 (diff)
Issue #2476407 by borisson_, hussainweb, znerol, Fabianx, Wim Leers, dawehner, Crell, Berdir: Use CacheableResponseInterface to determine which responses should be cached
Diffstat (limited to 'core/modules/system/src/FileDownloadController.php')
-rw-r--r--core/modules/system/src/FileDownloadController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/system/src/FileDownloadController.php b/core/modules/system/src/FileDownloadController.php
index a65342d..f8354ca 100644
--- a/core/modules/system/src/FileDownloadController.php
+++ b/core/modules/system/src/FileDownloadController.php
@@ -59,7 +59,11 @@ class FileDownloadController extends ControllerBase {
}
if (count($headers)) {
- 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');
}
throw new AccessDeniedHttpException();