Browse files

MDL-39832 Files: Revert MDL-39688 commit, 161be92

MDL-39688 has been successful in providing a solution for the issue but further
investigations done in MDL-39832 have got the evidence that the given solution
is more likely a workaround.
  • Loading branch information...
1 parent fb41a38 commit 31afec2312e3e51ebc01b4019602edf7960ea7b4 @scara scara committed Jun 3, 2013
Showing with 1 addition and 15 deletions.
  1. +1 −9 lib/filelib.php
  2. +0 −6 lib/xsendfilelib.php
View
10 lib/filelib.php
@@ -2022,11 +2022,7 @@ function readfile_accel($file, $mimetype, $accelerate) {
header('Last-Modified: '. gmdate('D, d M Y H:i:s', $lastmodified) .' GMT');
if (is_object($file)) {
- if (empty($_SERVER['HTTP_RANGE'])) {
- // Use Etag only when not byteserving,
- // is it tag of this range or whole file?
- header('Etag: ' . $file->get_contenthash());
- }
+ header('ETag: ' . $file->get_contenthash());
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) and $_SERVER['HTTP_IF_NONE_MATCH'] === $file->get_contenthash()) {
header('HTTP/1.1 304 Not Modified');
return;
@@ -2676,10 +2672,6 @@ function byteserving_send_file($handle, $mimetype, $ranges, $filesize) {
// better turn off any kind of compression and buffering
@ini_set('zlib.output_compression', 'Off');
- // Remove Etag because is is not strictly defined for byteserving,
- // is it tag of this range or whole file?
- header_remove('Etag');
-
$chunksize = 1*(1024*1024); // 1MB chunks - must be less than 2MB!
if ($handle === false) {
die;
View
6 lib/xsendfilelib.php
@@ -68,12 +68,6 @@ function xsendfile($filepath) {
}
}
- // Remove Etag because is is not strictly defined for byteserving,
- // is it tag of this range or whole file?
- if (!empty($_SERVER['HTTP_RANGE'])) {
- header_remove('Etag');
- }
-
if ($CFG->xsendfile === 'X-LIGHTTPD-send-file') {
// http://redmine.lighttpd.net/projects/lighttpd/wiki/X-LIGHTTPD-send-file says 1.4 it does not support byteserving
header('Accept-Ranges: none');

0 comments on commit 31afec2

Please sign in to comment.