]> git.plutz.net Git - cgilite/commitdiff
conform to standard by sending cache information with 304 response
authorpaul <paul@plutz.net>
Tue, 8 Nov 2016 13:47:08 +0000 (13:47 +0000)
committerpaul <paul@plutz.net>
Tue, 8 Nov 2016 13:47:08 +0000 (13:47 +0000)
svn path=/trunk/; revision=39

static.sh

index ec860c6efb3a8a10158a1233ad7fdebcd5ce2eda..44c6556ed147a91e99218e2600bda85f09972c4b 100755 (executable)
--- a/static.sh
+++ b/static.sh
@@ -30,7 +30,8 @@ suffix[css]="text/css"
 if [ -x "$file" -o \! -r "$file" -o \! -f "$file" ]; then
   printf 'HTTP/1.1 403 Forbidden\r\n\r\n'
 elif [ "$date" = "$HTTP_IF_NONE_MATCH" ]; then
-  printf 'HTTP/1.1 304 Not Modified\r\n\r\n'
+  printf 'HTTP/1.1 304 Not Modified\r\n'
+  printf 'Etag: %s\r\n\r\n' "$date"
 else
   length="$(stat -c %s "$file")"
   magic="${suffix[${file##*.}]:-$(file -bi "$file")}"