Merge pull request #6426 from linaspasv/2.x

Do not send unnecessary headers when pretending to be a file
This commit is contained in:
Dan Harrin
2023-05-05 16:05:43 +01:00
committed by GitHub
@@ -74,11 +74,17 @@ class AssetController
]);
}
return response()->file($path, [
'Content-Type' => $contentType,
'Expires' => $this->getHttpDate($expires),
'Cache-Control' => $cacheControl,
'Last-Modified' => $this->getHttpDate($lastModified),
]);
response()
->file($path, [
'Accept-Ranges' => 'bytes',
'Content-Length' => filesize($path),
'Content-Type' => $contentType,
'Expires' => $this->getHttpDate($expires),
'Cache-Control' => $cacheControl,
'Last-Modified' => $this->getHttpDate($lastModified),
])
->send();
exit();
}
}