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

Extracted download response logic to its own class

Cleans up base controller and groups up download & streaming logic for
potential future easier addition of range request support.
This commit is contained in:
Dan Brown
2022-06-08 23:50:42 +01:00
parent e72ade727d
commit abc283fc64
11 changed files with 108 additions and 106 deletions

View File

@ -233,10 +233,10 @@ class AttachmentController extends Controller
$attachmentStream = $this->attachmentService->streamAttachmentFromStorage($attachment);
if ($request->get('open') === 'true') {
return $this->streamedInlineDownloadResponse($attachmentStream, $fileName);
return $this->download()->streamedInline($attachmentStream, $fileName);
}
return $this->streamedDownloadResponse($attachmentStream, $fileName);
return $this->download()->streamedDirectly($attachmentStream, $fileName);
}
/**