]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_lua: Decline to serve a request if the script doesn't exist, instead of throwing...
authorDaniel Gruno <humbedooh@apache.org>
Tue, 7 Aug 2012 17:29:26 +0000 (17:29 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Tue, 7 Aug 2012 17:29:26 +0000 (17:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1370377 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/lua/mod_lua.c

diff --git a/CHANGES b/CHANGES
index 257af74c20e856d3434abdb33f9af59cf4cf3ae9..0a7538cded035ccca47431fb82f5fc82fb0189ed 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_lua: Decline handling 'lua-script' if the file doesn't exist,
+     rather than throwing an internal server error. [Daniel Gruno]
+
   *) mod_lua: Add functions r:flush and r:sendfile as well as additional
      request information to the request_rec structure. [Daniel Gruno]
 
index dab098cbe6a0cbfe59965dfa865008fd51892539..5deb3fe2c5a788a463e302928659a409a5dfbdec 100644 (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);