Skip to content

Commit

Permalink
MDL-39832 Files: Fixed ETag format according with RFC2616.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scara committed Jun 6, 2013
1 parent d618e3c commit 52286ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,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;
Expand Down

0 comments on commit 52286ac

Please sign in to comment.