soulbird commented on code in PR #8824:
URL: https://github.com/apache/apisix/pull/8824#discussion_r1109225466
##########
t/core/request.t:
##########
@@ -439,3 +439,59 @@ while ($i <= 101) {
$s
--- response_body
101
+
+
+
+=== TEST 15: add header
+--- config
+ location /t {
+ content_by_lua_block {
+ local core = require("apisix.core")
+ ngx.ctx.api_ctx = {}
+ local ctx = ngx.ctx.api_ctx
+ core.request.add_header(ctx, "test_header", "test")
+ local h = core.request.header(ctx, "test_header")
+ ngx.say(h)
+ }
+ }
+--- response_body
+test
+
+
+
+=== TEST 16: test invalidated cache for add_header
+--- config
+ location /t {
+ content_by_lua_block {
+ local core = require("apisix.core")
+ ngx.ctx.api_ctx = {}
+ local ctx = ngx.ctx.api_ctx
+ core.request.add_header(ctx, "test_header", "test")
+ local h = core.request.header(ctx, "test_header")
+ ngx.say(ctx.headers.test_header)
+ core.request.add_header(ctx, "test_header", "abc")
+ ngx.say(ctx.headers.test_header)
+ }
+ }
+--- response_body
+test
+nil
Review Comment:
Why does `add_header()` invalidate the cache?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]