]> git.agnieray.net Git - galette.git/commitdiff
Drop content lenght headers; closes #1342 #1343 #1347 #1348
authorJohan Cwiklinski <jcwiklinski@teclib.com>
Sun, 17 Nov 2019 13:20:57 +0000 (14:20 +0100)
committerJohan Cwiklinski <jcwiklinski@teclib.com>
Sun, 17 Nov 2019 13:20:57 +0000 (14:20 +0100)
galette/includes/main.inc.php
galette/includes/routes/management.routes.php
galette/includes/routes/members.routes.php
galette/lib/Galette/Core/Picture.php

index cd45e061010f3e94f8a8c9fdb3fd49bf33c7edb7..15ec89ffe3d4279770b4bae28be3aebbdb0443fb 100644 (file)
@@ -87,6 +87,7 @@ if ($needs_update) {
             'settings' => [
                 'determineRouteBeforeAppMiddleware' => true,
                 'displayErrorDetails' => (GALETTE_MODE === 'DEV'),
+                'addContentLengthHeader' => false,
                 // monolog settings
                 'logger' => [
                     'name'  => 'galette',
index f791dbd52c2968879312f73ab1c2ab820299c92f..a2f6b369a4a6f29ec8311cab8473836e7fdd7242 100644 (file)
@@ -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));
index 22105ea4261842baaf1e0d40772a344398955d34..bdf9aa3a798204df9b48b3f5ea8fdc383d020582 100644 (file)
@@ -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));
index 06d88d46c73c659b5205bba6390aa05fea3a97e5..ce9959c8fac2a19e8c10924c7b9fcfb98debb446 100644 (file)
@@ -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);