diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-20 14:34:50 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-20 14:34:50 +0000 |
commit | 1ecf7ac9fa9499d79ccebf805090b2fd1310f3d9 (patch) | |
tree | fa1d868a88b9ef238904669c6b9f88d024462ad5 | |
parent | 074690aa549db034b9d1599b9fa38dfd577db868 (diff) |
uhttpd: do lua lookup first, otherwise fs resources might shadow the virtual url
-rw-r--r-- | contrib/package/uhttpd/src/uhttpd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/package/uhttpd/src/uhttpd.c b/contrib/package/uhttpd/src/uhttpd.c index f2972a046..ccbc9efc6 100644 --- a/contrib/package/uhttpd/src/uhttpd.c +++ b/contrib/package/uhttpd/src/uhttpd.c @@ -668,6 +668,14 @@ int main (int argc, char **argv) /* parse message header */ if( (req = uh_http_header_recv(cl)) != NULL ) { +#ifdef HAVE_LUA + /* Lua request? */ + if( strstr(req->url, conf.lua_prefix) == req->url ) + { + uh_lua_request(cl, req, L); + } + else +#endif /* dispatch request */ if( (pin = uh_path_lookup(cl, req->url)) != NULL ) { @@ -682,13 +690,7 @@ int main (int argc, char **argv) uh_file_request(cl, req, pin); } } -#ifdef HAVE_LUA - /* Lua request? */ - else if( strstr(req->url, conf.lua_prefix) == req->url ) - { - uh_lua_request(cl, req, L); - } -#endif + /* 404 */ else { |