From b74960ecd342154de60881a0f00eaa6816012fdb Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 16 Oct 2017 13:32:01 +0200 Subject: [PATCH] Fix download issue --- src/Gist/Controller/ViewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gist/Controller/ViewController.php b/src/Gist/Controller/ViewController.php index fd9f262..44aeedc 100644 --- a/src/Gist/Controller/ViewController.php +++ b/src/Gist/Controller/ViewController.php @@ -131,7 +131,7 @@ class ViewController extends Controller 200, array( 'Content-Disposition' => sprintf('filename=%s.%s', $gist->getFile(), $gist->getTypeAsExtension()), - 'Content-Length' => filesize($file), + 'Content-Length' => mb_strlen($viewOptions['raw_content']), 'Content-Type' => 'application/force-download', ) );