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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user