keplerproject / wsapi

WSAPI is an API that abstracts the web server from Lua web applications.
http://keplerproject.github.io/wsapi
74 stars 33 forks source link

Incorrect path supplied by wsapi.cgi #37

Open davidgiven opened 9 years ago

davidgiven commented 9 years ago

wsapi.cgi uses "$@" to get the path to the script. This doesn't work if the script path is a relative filename such as 'fnord.cgi'; the path parsing fails later on as it gets confused about where the script is.

I've managed to bodge it by using "$PWD/$@", but it should really be canonicalising the path.

(Apache's suexec does this; it seems to cd into the cgi-bin directory before running the script.)