diff --git a/apisix/core/request.lua b/apisix/core/request.lua index 98b357f7a07b..e76bbf79a417 100644 --- a/apisix/core/request.lua +++ b/apisix/core/request.lua @@ -55,17 +55,17 @@ local function _headers(ctx) end if not is_apisix_or then - return get_headers(0) + return get_headers() end if a6_request.is_request_header_set() then a6_request.clear_request_header() - ctx.headers = get_headers(0) + ctx.headers = get_headers() end local headers = ctx.headers if not headers then - headers = get_headers(0) + headers = get_headers() ctx.headers = headers end diff --git a/t/core/request.t b/t/core/request.t index dc9a82c2e748..c343e2d28fa8 100644 --- a/t/core/request.t +++ b/t/core/request.t @@ -421,28 +421,7 @@ POST -=== TEST 14: get header ---- config - location /t { - content_by_lua_block { - local core = require("apisix.core") - ngx.say(core.request.header(ngx.ctx, "X-101")) - } - } ---- more_headers eval -my $i = 1; -my $s; -while ($i <= 101) { - $s .= "X-$i:$i\n"; - $i++; -} -$s ---- response_body -101 - - - -=== TEST 15: add header +=== TEST 14: add header --- config location /t { content_by_lua_block { @@ -468,7 +447,7 @@ test -=== TEST 16: call add_header with deprecated way +=== TEST 15: call add_header with deprecated way --- config location /t { content_by_lua_block {