This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 25da64204 fix(request.headers): No longer returns all http headers, 
but limited to the default 100. (#11140)
25da64204 is described below

commit 25da642045ddb24b16dea49fd3538557218f9681
Author: Ashing Zheng <[email protected]>
AuthorDate: Wed Apr 10 17:36:24 2024 +0800

    fix(request.headers): No longer returns all http headers, but limited to 
the default 100. (#11140)
    
    Signed-off-by: ashing <[email protected]>
---
 apisix/core/request.lua |  6 +++---
 t/core/request.t        | 25 ++-----------------------
 2 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/apisix/core/request.lua b/apisix/core/request.lua
index 98b357f7a..e76bbf79a 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 dc9a82c2e..c343e2d28 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 {

Reply via email to