AlinsRan opened a new issue, #11325:
URL: https://github.com/apache/apisix/issues/11325
### Current Behavior
1. send a request with header `xtag: b`
```shell
curl http://127.0.0.1:9080/get -H "xtag: b"
```
2. accessing and updating header `xtag` in apisix.
After the update, when accessing the HTTP header `xtag` through ctx.var, it
was expected to receive `a` but received `b`
```lua
-- get: b
core.log.info("ctx.var.http_xtag: ", ctx.var.http_xtag)
-- set header, xtag = a
core.request.set_header(ctx, "xtag", "a")
-- get: b
-- expect: a
core.log.info("ctx.var.http_xtag: ", ctx.var.http_xtag)
```
As shown in the above example, when using ctx.var to retrieve the HTTP
header, once the value is cached, it will no longer be updated.
### Expected Behavior
When updating the HTTP header, the ctx.var cache will also be updated.
### Error Logs
_No response_
### Steps to Reproduce
1.
### Environment
- APISIX version (run `apisix version`): 3.9.0
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
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]