]> granicus.if.org Git - apache/commitdiff
allow setting of r->user from lua
authorBrian McCallister <brianm@apache.org>
Wed, 4 Nov 2009 23:28:22 +0000 (23:28 +0000)
committerBrian McCallister <brianm@apache.org>
Wed, 4 Nov 2009 23:28:22 +0000 (23:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832905 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_request.c

index 6f01da5e787c5c1c2fc899f3c52b313e989a8f7d..f589ad7480c9645a0513042426b3223015db9a96 100644 (file)
@@ -478,6 +478,12 @@ static int req_newindex(lua_State *L)
         return 0;
     }
 
+    if (0 == apr_strnatcmp("user", key)) {
+        const char *value = luaL_checkstring(L, 3);
+        r->user = apr_pstrdup(r->pool, value);
+        return 0;
+    }
+
     lua_pushstring(L,
                    apr_psprintf(r->pool,
                                 "Property [%s] may not be set on a request_rec",