Verified Commit b257adec authored by Clay Freeman's avatar Clay Freeman
Browse files

Issue #3313534 by hargurpreet, clayfreeman: Media files not rendering properly

parent 0f80e49c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -108,6 +108,14 @@ class DownloadController extends ControllerBase {
      $response->setContentDisposition('inline');
    }

    // Use a default MIME type of 'application/octet-stream'.
    $response->headers->set('Content-Type', 'application/octet-stream');

    // If the file has an associated MIME type, include it in the response.
    if (!empty($mime_type = $file->getMimeType())) {
      $response->headers->set('Content-Type', $mime_type);
    }

    // Clear the Cache-Control header so it can be calculated automatically.
    $response->headers->set('Cache-Control', '');