From: Johan Cwiklinski Date: Sun, 17 Nov 2019 13:20:57 +0000 (+0100) Subject: Drop content lenght headers; closes #1342 #1343 #1347 #1348 X-Git-Tag: 0.9.3~24 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=9fd79d4e8a836769dceea5f5c13630ec256740ce;p=galette.git Drop content lenght headers; closes #1342 #1343 #1347 #1348 --- diff --git a/galette/includes/main.inc.php b/galette/includes/main.inc.php index cd45e0610..15ec89ffe 100644 --- a/galette/includes/main.inc.php +++ b/galette/includes/main.inc.php @@ -87,6 +87,7 @@ if ($needs_update) { 'settings' => [ 'determineRouteBeforeAppMiddleware' => true, 'displayErrorDetails' => (GALETTE_MODE === 'DEV'), + 'addContentLengthHeader' => false, // monolog settings 'logger' => [ 'name' => 'galette', diff --git a/galette/includes/routes/management.routes.php b/galette/includes/routes/management.routes.php index f791dbd52..a2f6b369a 100644 --- a/galette/includes/routes/management.routes.php +++ b/galette/includes/routes/management.routes.php @@ -1369,8 +1369,7 @@ $app->get( ->withHeader('Content-Transfer-Encoding', 'binary') ->withHeader('Expires', '0') ->withHeader('Cache-Control', 'must-revalidate') - ->withHeader('Pragma', 'public') - ->withHeader('Content-Length', filesize($filepath)); + ->withHeader('Pragma', 'public'); $stream = fopen('php://memory', 'r+'); fwrite($stream, file_get_contents($filepath)); diff --git a/galette/includes/routes/members.routes.php b/galette/includes/routes/members.routes.php index 22105ea42..bdf9aa3a7 100644 --- a/galette/includes/routes/members.routes.php +++ b/galette/includes/routes/members.routes.php @@ -350,8 +350,7 @@ $app->get( ->withHeader('Content-Transfer-Encoding', 'binary') ->withHeader('Expires', '0') ->withHeader('Cache-Control', 'must-revalidate') - ->withHeader('Pragma', 'public') - ->withHeader('Content-Length', filesize($filepath)); + ->withHeader('Pragma', 'public'); $stream = fopen('php://memory', 'r+'); fwrite($stream, file_get_contents($filepath)); diff --git a/galette/lib/Galette/Core/Picture.php b/galette/lib/Galette/Core/Picture.php index 06d88d46c..ce9959c8f 100644 --- a/galette/lib/Galette/Core/Picture.php +++ b/galette/lib/Galette/Core/Picture.php @@ -297,7 +297,6 @@ class Picture implements FileInterface public function display() { header('Content-type: '.$this->mime); - header('Content-Length: ' . filesize($this->file_path)); ob_clean(); flush(); readfile($this->file_path);