Skip to content

Commit f2e849a

Browse files
author
aviramc
committed
Added an options table to clean_header as well.
1 parent 1c5e5b9 commit f2e849a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/ngx_http_lua_headers.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -589,15 +589,9 @@ ngx_http_lua_ngx_req_header_clear(lua_State *L)
589589
}
590590

591591
if (n == 2) {
592-
u_char *p;
593-
size_t len;
594-
int replace_underscores = 1;
595-
p = (u_char *) luaL_checklstring(L, 1, &len);
596-
replace_underscores = lua_toboolean(L, 2);
597-
lua_pop(L, 2);
598-
lua_pushlstring(L, (char *) p, len);
599592
lua_pushnil(L);
600-
lua_pushboolean(L, replace_underscores);
593+
/* Top element is now 3, replace it with element 3 */
594+
lua_insert(L, 2);
601595
} else {
602596
lua_pushnil(L);
603597
}

0 commit comments

Comments
 (0)