fix pdf view

This commit is contained in:
kuaifan 2022-09-30 22:53:56 +08:00
parent 0d74e8f04b
commit ce162bf414

View File

@ -290,7 +290,9 @@ class IndexController extends InvokeController
$userAgent = strtolower(Request::server('HTTP_USER_AGENT'));
if ($ext === 'pdf'
&& (str_contains($userAgent, 'electron') || str_contains($userAgent, 'chrome'))) {
return response()->download($file, $name, [], 'inline');
return response()->download($file, $name, [
'Content-Type' => 'application/pdf'
], 'inline');
}
//
if (in_array($ext, File::localExt)) {