MDL-39832 Files: Fixed ETag format according with RFC2616.
authorMatteo Scaramuccia <moodle@matteoscaramuccia.com>
Sat, 1 Jun 2013 10:34:40 +0000 (12:34 +0200)
committerMatteo Scaramuccia <moodle@matteoscaramuccia.com>
Sun, 7 Jul 2013 07:21:37 +0000 (09:21 +0200)
ETag must be double quoted,
http://tools.ietf.org/html/rfc2616#section-3.11:

      entity-tag = [ weak ] opaque-tag
      weak       = "W/"
      opaque-tag = quoted-string

lib/filelib.php

index 92e6cdf..2838a33 100644 (file)
@@ -1956,7 +1956,7 @@ function readfile_accel($file, $mimetype, $accelerate) {
     header('Last-Modified: '. gmdate('D, d M Y H:i:s', $lastmodified) .' GMT');
 
     if (is_object($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;