]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1870650 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 30 Jan 2020 15:11:21 +0000 (15:11 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 30 Jan 2020 15:11:21 +0000 (15:11 +0000)
PR63971 expose apr_table_unset for headers/envvars

via nil assignment

Submitted by: covener
Reviewed by: covener, jim, humbedooh

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1873366 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/lua/lua_apr.c

diff --git a/CHANGES b/CHANGES
index 1076b6061dabeab6dc7fcb02e11f343216fcbfa2..ec3edf278465f6cf15191c3d0880a7a9c7cb3752 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.42
 
+  *) mod_lua: Accept nil assignments to the exposed tables (r.subprocess_env, 
+     r.headers_out, etc) to remove the key from the table. PR63971. 
+     [Eric Covener]
+
   *) mod_http2: Fixed interaction with mod_reqtimeout. A loaded mod_http2 was disabling the
      ssl handshake timeouts. Also, fixed a mistake of the last version that made `H2Direct` 
      always `on`, irregardless of configuration. Found and reported by
diff --git a/STATUS b/STATUS
index 7211716286bca6277424014fdd766094a47011ec..c8b62131a6840cb6a983e6d5d4c0ab4de4ca2efc 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -132,12 +132,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_lua: allow nil assignment to trigger apr_table_unset
-           (nil assignment to an APR table used to throw an error)
-     trunk patch: http://svn.apache.org/r1870650
-     2.4.x patch: svn merge -c 1870650 ^/httpd/httpd/trunk
-     +1: covener, jim, humbedooh
-
   *) mod_lua: add _table() methods to return raw r/o lua tables that can be
      iterated over for headers/notes/subprocess_env:
      trunk patch: http://svn.apache.org/r1872455
index 8e34cf30828b595147200dca0c3538ac6d805c55..9590fd6e18aa1e1155d63b60b94700ef1d80f85b 100644 (file)
@@ -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