Hello Apache HTTP Server Community,

I am seeking clarification regarding a warning generated by mod_lua in Apache 
HTTP Server.

Environment
-----------
- Apache HTTP Server: 2.4.37
- Operating System: RHEL 8.x
- Lua Version: 5.3
- Module: mod_lua

Background
----------
I have implemented a Lua handler (nonce.lua) using LuaMapHandler to generate a 
Content Security Policy (CSP) nonce for each request. The handler reads 
index.html, replaces the nonce placeholder, sets the appropriate CSP response 
header, and serves the modified HTML.

The application is functioning as expected:
- The webpage loads successfully.
- The CSP nonce is generated correctly.
- The Content-Security-Policy header is set correctly.
- There are no functional issues observed.

However, Apache logs the following warning for every request:

AH02483: lua: Lua handler handle in /var/www/nonce.lua did not return a value, 
assuming apache2.OK

My Lua handler completes successfully but does not explicitly return a value.

My questions are:

1. Is this warning expected behavior when the Lua handler does not explicitly 
return a status code?
2. Is it recommended to explicitly return `apache2.OK` (or another Apache 
status code) at the end of the handler to avoid this warning?
3. Could leaving the handler without an explicit return have any side effects 
or is it purely an informational warning?
4. Is there a recommended best practice for LuaMapHandler implementations 
regarding return values?

If needed, I can provide:
- Apache error log
- Apache module information

Thank you for your time and guidance.

Best regards,
Kumaresan S

Reply via email to