Commit 5b4c4715 authored by Pierre Rudloff's avatar Pierre Rudloff Committed by Alex Moreno Lopez
Browse files

Issue #3222135 by prudloff: Wrong Content-Type header

parent 70961fa2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -180,10 +180,10 @@ class FileDownloadController extends ControllerBase {
   *   The transferred file as response.
   */
  protected function webpResponse($file, array $headers, $scheme) {
    $headers += [
    $headers = array_merge($headers, [
      'Content-Type' => 'image/webp',
      'Content-Length' => filesize($file),
    ];
    ]);
    // \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
+4 −4
Original line number Diff line number Diff line
@@ -234,10 +234,10 @@ class ImageStyleDownloadController extends FileDownloadController {
   *   The transferred file as response.
   */
  protected function webpResponse($file, array $headers, $scheme) {
    $headers += [
    $headers = array_merge($headers, [
      'Content-Type' => 'image/webp',
      'Content-Length' => filesize($file),
    ];
    ]);
    // \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
@@ -259,10 +259,10 @@ class ImageStyleDownloadController extends FileDownloadController {
   *   The transferred file as response.
   */
  protected function response(Image $image, array $headers, $scheme) {
    $headers += [
    $headers = array_merge($headers, [
      'Content-Type' => $image->getMimeType(),
      'Content-Length' => $image->getFileSize(),
    ];
    ]);
    // \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