1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

mod_lua: Decline to serve a request if the script doesn't exist, instead of throwing an internal server error.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370377 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Gruno
2012-08-07 17:29:26 +00:00
parent 5b08977d0f
commit d7b20ffb70
2 changed files with 11 additions and 0 deletions

View File

@@ -236,6 +236,14 @@ static int lua_handler(request_rec *r)
if (strcmp(r->handler, "lua-script")) {
return DECLINED;
}
/* Decline the request if the script does not exist (or is a directory),
* rather than just returning internal server error */
if (
(r->finfo.filetype == APR_NOFILE)
|| (r->finfo.filetype & APR_DIR)
) {
return DECLINED;
}
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(01472)
"handling [%s] in mod_lua", r->filename);