File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -574,27 +574,21 @@ ngx_http_lua_ngx_req_header_clear(lua_State *L)
574
574
{
575
575
ngx_uint_t n ;
576
576
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" ,
579
579
lua_gettop (L ));
580
580
}
581
581
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
+
590
584
return ngx_http_lua_ngx_req_header_set_helper (L );
591
585
}
592
586
593
587
594
588
static int
595
589
ngx_http_lua_ngx_req_header_set (lua_State * L )
596
590
{
597
- if (( lua_gettop (L ) != 2 ) && ( lua_gettop ( L ) != 3 ) ) {
591
+ if (lua_gettop (L ) != 2 ) {
598
592
return luaL_error (L , "expecting two arguments, but seen %d" ,
599
593
lua_gettop (L ));
600
594
}
@@ -632,10 +626,9 @@ ngx_http_lua_ngx_req_header_set_helper(lua_State *L)
632
626
633
627
#if 0
634
628
/* 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 ] = '-' ;
639
632
}
640
633
}
641
634
#endif
You can’t perform that action at this time.
0 commit comments