Skip to content

Instantly share code, notes, and snippets.

@hcooper
Last active August 29, 2015 14:03
Show Gist options
  • Save hcooper/a1c7a882914679a0ccc9 to your computer and use it in GitHub Desktop.
Save hcooper/a1c7a882914679a0ccc9 to your computer and use it in GitHub Desktop.
Koken calculates and returns a Content-Length header, regardless of the server is going to compress/chunk the response.
commit 74ae5fa6e841bbe1092cf6262fb6031b44fa9b4c
Author: Hereward Cooper <coops@fawk.eu>
Date: Mon Jul 14 14:46:17 2014 -0700
disabling content-length header
diff --git a/i.php b/i.php
index a6c704e..52446b2 100755
--- a/i.php
+++ b/i.php
@@ -416,7 +416,6 @@
}
header('Content-type: image/' . $ext);
- header('Content-length: ' . filesize($file));
header('Cache-Control: public');
header('Expires: ' . gmdate('D, d M Y H:i:s', strtotime('+1 year')) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file)) . ' GMT');
@@ -426,4 +425,4 @@
readfile($file);
} else {
die(file_get_contents($file));
- }
\ No newline at end of file
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment