1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Extracted download response logic into controller method

Fixes incorrect 'Content-Disposition' header value.
Fixes #581
This commit is contained in:
Dan Brown
2018-09-22 11:34:09 +01:00
parent c47b578599
commit 5c2e3f4e56
5 changed files with 27 additions and 44 deletions

View File

@ -201,10 +201,7 @@ class AttachmentController extends Controller
}
$attachmentContents = $this->attachmentService->getAttachmentFromStorage($attachment);
return response($attachmentContents, 200, [
'Content-Type' => 'application/octet-stream',
'Content-Disposition' => 'attachment; filename="'. $attachment->getFileName() .'"'
]);
return $this->downloadResponse($attachmentContents, $attachment->getFileName());
}
/**