summaryrefslogtreecommitdiffstats
path: root/core/modules/system/src/FileDownloadController.php
diff options
context:
space:
mode:
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();