]> git.plutz.net Git - cgilite/blobdiff - server.sh
in server mode: serve static files from data dir
[cgilite] / server.sh
index dc97607e3f41475325d7d1e15b5302e9acf0a83a..4eb253ffe2696f5ac5be0b60be18d91da74b2511 100755 (executable)
--- a/server.sh
+++ b/server.sh
@@ -84,3 +84,10 @@ HTTP_format(){
   bX
   '
 }
+
+PATH_INFO="$(invalidate "${PATH_INFO}" '(^|.*/)\.\./.*' '')"
+
+if [ -z "$QUERY_STRING" -a -f "$_DATA/$PATH_INFO" ]; then
+  . "$_EXEC/shcgi/static.sh" "$_DATA/$PATH_INFO"
+  exit 0
+fi |HTTP_format