Skip to content

Commit e9e1dec

Browse files
author
aviram
committed
Reverted unnecessary changes.
1 parent e699fcc commit e9e1dec

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/ngx_http_lua_headers.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -574,27 +574,21 @@ ngx_http_lua_ngx_req_header_clear(lua_State *L)
574574
{
575575
ngx_uint_t n;
576576
n = lua_gettop(L);
577-
if ((n != 1) && (n != 2)) {
578-
return luaL_error(L, "expecting one or two arguments, but seen %d",
577+
if (lua_gettop(L) != 1) {
578+
return luaL_error(L, "expecting one arguments, but seen %d",
579579
lua_gettop(L));
580580
}
581581

582-
if (n == 2) {
583-
lua_pushnil(L);
584-
/* Top element is now 3, replace it with element 3 */
585-
lua_insert(L, 2);
586-
} else {
587-
lua_pushnil(L);
588-
}
589-
582+
lua_pushnil(L);
583+
590584
return ngx_http_lua_ngx_req_header_set_helper(L);
591585
}
592586

593587

594588
static int
595589
ngx_http_lua_ngx_req_header_set(lua_State *L)
596590
{
597-
if ((lua_gettop(L) != 2) && (lua_gettop(L) != 3)) {
591+
if (lua_gettop(L) != 2) {
598592
return luaL_error(L, "expecting two arguments, but seen %d",
599593
lua_gettop(L));
600594
}
@@ -632,10 +626,9 @@ ngx_http_lua_ngx_req_header_set_helper(lua_State *L)
632626

633627
#if 0
634628
/* replace "_" with "-" */
635-
for (i = 0; i < len; i++) {
636-
if (p[i] == '_') {
637-
p[i] = '-';
638-
}
629+
for (i = 0; i < len; i++) {
630+
if (p[i] == '_') {
631+
p[i] = '-';
639632
}
640633
}
641634
#endif

0 commit comments

Comments
 (0)