about summary refs log tree commit diff stats
path: root/classes/Handler/DownloadHandler.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-05-28 07:12:59 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-05-28 07:12:59 +0300
commit5007508dc8e461553aeaf47e49a1f538da881335 (patch)
treec885eed7c65b463fadaa87d1ca5b5eedb6891e75 /classes/Handler/DownloadHandler.php
parent78bfc53e084afddcff6450173ae594ee8df279ac (diff)
downloadthe-epube-5007508dc8e461553aeaf47e49a1f538da881335.tar.gz
the-epube-5007508dc8e461553aeaf47e49a1f538da881335.tar.xz
replace readfile() with file_get_contents() because otherwise body gets sent before headers
Diffstat (limited to 'classes/Handler/DownloadHandler.php')
-rw-r--r--classes/Handler/DownloadHandler.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/classes/Handler/DownloadHandler.php b/classes/Handler/DownloadHandler.php
index bf450e0..023ae8a 100644
--- a/classes/Handler/DownloadHandler.php
+++ b/classes/Handler/DownloadHandler.php
@@ -25,7 +25,7 @@ class DownloadHandler implements RequestHandlerInterface, AuthRequired
 				return (new Response())
 					->withHeader("Content-type", mime_content_type($filename))
 					->withHeader("Content-Disposition", 'attachment; filename="' . basename($filename) . '"')
-					->withBody(readfile($filename) ?: '');
+					->withBody(file_get_contents($filename) ?: '');
 			}
 		}