File tree 3 files changed +24
-3
lines changed
3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ local function _headers(ctx)
43
43
end
44
44
local headers = ctx .headers
45
45
if not headers then
46
- headers = get_headers ()
46
+ headers = get_headers (0 )
47
47
ctx .headers = headers
48
48
end
49
49
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ function _M.check_schema(conf)
66
66
end
67
67
68
68
69
- function _M .rewrite (conf )
70
- local headers = ngx . req . get_headers ( )
69
+ function _M .rewrite (conf , ctx )
70
+ local headers = core . request . headers ( ctx )
71
71
72
72
if conf .header_schema then
73
73
local ok , err = core .schema .check (conf .header_schema , headers )
Original file line number Diff line number Diff line change @@ -422,3 +422,24 @@ the post form is too large: request body in temp file not supported
422
422
POST /t
423
423
--- response_body
424
424
POST
425
+
426
+
427
+
428
+ === TEST 14: get header
429
+ --- config
430
+ location /t {
431
+ content_by_lua_block {
432
+ local core = require("apisix.core")
433
+ ngx.say(core.request.header(ngx.ctx, "X-101"))
434
+ }
435
+ }
436
+ --- more_headers eval
437
+ my $i = 1;
438
+ my $s;
439
+ while ($i <= 101) {
440
+ $s .= "X-$i:$i\n";
441
+ $i++;
442
+ }
443
+ $s
444
+ --- response_body
445
+ 101
You can’t perform that action at this time.
0 commit comments