Fix Laravel Pint formatting
This commit is contained in:
@@ -35,7 +35,7 @@ class FileServeService
|
||||
|
||||
$headers = [
|
||||
'Content-Type' => $meta['mime'],
|
||||
'Content-Disposition' => 'inline; filename="' . $meta['download_name'] . '"',
|
||||
'Content-Disposition' => 'inline; filename="'.$meta['download_name'].'"',
|
||||
'Content-Length' => (string) $meta['size'],
|
||||
'ETag' => $meta['etag'],
|
||||
'Last-Modified' => $meta['last_modified'],
|
||||
@@ -53,20 +53,20 @@ class FileServeService
|
||||
}
|
||||
|
||||
$ext = strtolower(pathinfo($name, PATHINFO_EXTENSION));
|
||||
if (!in_array($ext, $allowedExtensions, true)) {
|
||||
if (! in_array($ext, $allowedExtensions, true)) {
|
||||
throw new HttpException(404, 'File not found');
|
||||
}
|
||||
|
||||
$path = rtrim($baseDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name;
|
||||
if (!is_file($path)) {
|
||||
$path = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$name;
|
||||
if (! is_file($path)) {
|
||||
throw new HttpException(404, 'File not found');
|
||||
}
|
||||
|
||||
$mime = $this->detectMime($path);
|
||||
$mtime = filemtime($path) ?: time();
|
||||
$size = filesize($path) ?: 0;
|
||||
$etag = md5($name . '|' . $mtime . '|' . $size);
|
||||
$downloadName = $downloadName ? $downloadName . '.' . $ext : $name;
|
||||
$etag = md5($name.'|'.$mtime.'|'.$size);
|
||||
$downloadName = $downloadName ? $downloadName.'.'.$ext : $name;
|
||||
|
||||
return [
|
||||
'name' => $name,
|
||||
@@ -76,7 +76,7 @@ class FileServeService
|
||||
'size' => $size,
|
||||
'etag' => $etag,
|
||||
'download_name' => $downloadName,
|
||||
'last_modified' => gmdate('D, d M Y H:i:s', $mtime) . ' GMT',
|
||||
'last_modified' => gmdate('D, d M Y H:i:s', $mtime).' GMT',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user