Skip to content

Commit

Permalink
do not use formatted file size in content-length header, see #94 (#97)
Browse files Browse the repository at this point in the history
* do not use formatted file size in content-length header, see #94

* dont use pimcore file size check to keep BC
  • Loading branch information
solverat authored May 9, 2019
1 parent b4139f6 commit 9b2b2d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MembersBundle/Controller/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private function serveFile(Model\Asset $asset)
{
$forceDownload = true;
$contentType = $asset->getMimetype();
$fileSize = filesize($asset->getFileSystemPath());

/** @var Configuration $configuration */
$configuration = $this->container->get(Configuration::class);
Expand All @@ -76,7 +77,7 @@ private function serveFile(Model\Asset $asset)
$response->headers->set('Provider', 'Pimcore-Members');
$response->headers->set('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
$response->headers->set('Pragma', 'public');
$response->headers->set('Content-Length', $asset->getFileSize('noformatting'));
$response->headers->set('Content-Length', $fileSize);
$response->headers->set('Content-Disposition', $response->headers->makeDisposition(
$forceDownload ? ResponseHeaderBag::DISPOSITION_ATTACHMENT : ResponseHeaderBag::DISPOSITION_INLINE,
\Pimcore\File::getValidFilename(basename($asset->getFileName()))
Expand Down
Empty file.

0 comments on commit 9b2b2d5

Please sign in to comment.