]> git.plutz.net Git - cgilite/blobdiff - static.sh
Bugfix: keep last post element without appending empty element
[cgilite] / static.sh
index 153cce0e7428f717a64d7fa1ac95103d77808a57..ec860c6efb3a8a10158a1233ad7fdebcd5ce2eda 100755 (executable)
--- a/static.sh
+++ b/static.sh
@@ -19,7 +19,7 @@
 
 
 unset length date file suffix
-file="$_EXEC/static/$STATIC"
+file="$1"
 date="$(stat -c %Y "$file")"
 
 # allow overriding magic file recognition
@@ -28,9 +28,9 @@ declare -A suffix
 suffix[css]="text/css"
 
 if [ -x "$file" -o \! -r "$file" -o \! -f "$file" ]; then
-  printf 'HTTP/1.1 403 Forbidden\n\n'
+  printf 'HTTP/1.1 403 Forbidden\r\n\r\n'
 elif [ "$date" = "$HTTP_IF_NONE_MATCH" ]; then
-  printf 'HTTP/1.1 304 Not Modified\n\n'
+  printf 'HTTP/1.1 304 Not Modified\r\n\r\n'
 else
   length="$(stat -c %s "$file")"
   magic="${suffix[${file##*.}]:-$(file -bi "$file")}"