1
0
forked from GitHub/gf-core

gfse: grammars in the cloud, still primitve, but good enough to be installed on the server, I think

This commit is contained in:
hallgren
2011-07-07 16:57:59 +00:00
parent c7fffd861b
commit c4f1fbbc9a
2 changed files with 71 additions and 19 deletions

View File

@@ -145,6 +145,7 @@ case "$REQUEST_METHOD" in
ContentType="text/plain; charset=$charset"
cgiheaders
cd "$path"
shopt -s nullglob
echo_n *-*.json
else
error404
@@ -162,6 +163,7 @@ case "$REQUEST_METHOD" in
ContentType="text/plain; charset=$charset"
cgiheaders
cd "$path"
shopt -s nullglob
rm *.gf *.gfo *-*.json *.pgf grammars.cgi
cd ..
rmdir "$path"
@@ -195,6 +197,22 @@ case "$REQUEST_METHOD" in
*) error400
esac
;;
rm=*)
file=$(qparse "$QUERY_STRING" rm)
case "$file" in
/tmp/gfse.*/*.json) # shouldn't allow .. in path !!!
path="$documentRoot$file"
if [ -r "$path" ] ; then
ContentType="text/javascript; charset=$charset"
cgiheaders
rm "$path"
else
error404
fi
;;
*) error400
esac
;;
*) error400
esac
esac