summaryrefslogtreecommitdiffstats
path: root/modules/lua/lua_apr.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-25 04:41:27 +0000
commitc54018b07a9085c0a3aedbc2bd01a85a3b3e20cf (patch)
treef6e1d6fcf9f6db3794c418b2f89ecf9e08ff41c8 /modules/lua/lua_apr.c
parentAdding debian version 2.4.38-3+deb10u10. (diff)
downloadapache2-c54018b07a9085c0a3aedbc2bd01a85a3b3e20cf.tar.xz
apache2-c54018b07a9085c0a3aedbc2bd01a85a3b3e20cf.zip
Merging upstream version 2.4.59.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/lua/lua_apr.c')
-rw-r--r--modules/lua/lua_apr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/lua/lua_apr.c b/modules/lua/lua_apr.c
index 8e34cf3..9590fd6 100644
--- a/modules/lua/lua_apr.c
+++ b/modules/lua/lua_apr.c
@@ -39,7 +39,13 @@ static int lua_table_set(lua_State *L)
{
req_table_t *t = ap_lua_check_apr_table(L, 1);
const char *key = luaL_checkstring(L, 2);
- const char *val = luaL_checkstring(L, 3);
+ const char *val = luaL_optlstring(L, 3, NULL, NULL);
+
+ if (!val) {
+ apr_table_unset(t->t, key);
+ return 0;
+ }
+
/* Unless it's the 'notes' table, check for newline chars */
/* t->r will be NULL in case of the connection notes, but since
we aren't going to check anything called 'notes', we can safely