Skip to content

Commit 1c5e5b9

Browse files
author
aviramc
committed
Changed the replace_underscores parameter to a table of parameters (options), in which the only possible option currently is replace_underscores.
1 parent 886e27b commit 1c5e5b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ngx_http_lua_headers.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,11 @@ ngx_http_lua_ngx_req_header_set_helper(lua_State *L)
643643
ngx_http_lua_check_fake_request(L, r);
644644

645645
n = lua_gettop(L);
646-
if (n >= 3) {
647-
replace_underscores = lua_toboolean(L, 3);
646+
if (n == 3) {
647+
luaL_checktype(L, 3, LUA_TTABLE);
648+
lua_getfield(L, 3, "replace_underscores");
649+
replace_underscores = lua_toboolean(L, -1);
650+
lua_pop(L, 1);
648651
} else {
649652
replace_underscores = 1;
650653
}

0 commit comments

Comments
 (0)