Loading src/Controller/DisplayController.php +8 −0 Changes for src/Controller/DisplayController.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use Drupal\Core\Entity\RevisionableInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\file\FileInterface; Loading Loading @@ -187,6 +188,13 @@ class DisplayController extends EntityRevisionViewController { return $this->updateRenderCache(parent::__invoke($media, $view_mode), $config); } $response = new CacheableBinaryFileResponse($uri, Response::HTTP_OK, [], FALSE); $additional_public_schemes = array_diff(Settings::get('file_additional_public_schemes', []), [ 'private', 'temporary', ]); in_array($scheme, $additional_public_schemes, TRUE) ? $response->setPublic() : $response->setPrivate(); $response = new CacheableBinaryFileResponse($uri, Response::HTTP_OK, [], $scheme !== 'private'); $response->addCacheableDependency($media); $response->addCacheableDependency($file); Loading Loading
src/Controller/DisplayController.php +8 −0 Changes for src/Controller/DisplayController.php: 8 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use Drupal\Core\Entity\RevisionableInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\Settings; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\file\FileInterface; Loading Loading @@ -187,6 +188,13 @@ class DisplayController extends EntityRevisionViewController { return $this->updateRenderCache(parent::__invoke($media, $view_mode), $config); } $response = new CacheableBinaryFileResponse($uri, Response::HTTP_OK, [], FALSE); $additional_public_schemes = array_diff(Settings::get('file_additional_public_schemes', []), [ 'private', 'temporary', ]); in_array($scheme, $additional_public_schemes, TRUE) ? $response->setPublic() : $response->setPrivate(); $response = new CacheableBinaryFileResponse($uri, Response::HTTP_OK, [], $scheme !== 'private'); $response->addCacheableDependency($media); $response->addCacheableDependency($file); Loading