Replies: 3 comments 13 replies
-
function axasd:access(conf)
local bxxxx = kong.request.get_header("axxxx")
local c = "12312312312"
kong.service.request.set_header('axxxx',c)
end
|
Beta Was this translation helpful? Give feedback.
0 replies
-
In Kong 3.7, I am using the following Lua code: local headers = ngx.req.get_headers()
local headerxxx= headers["xxx"]
kong.service.request.set_header('xxxx', "111") This works fine. However, when I change it to: local headerxxx = ngx.var.http_xxx
kong.service.request.set_header('xxxx', "111") it does not work. I would like to understand why this happens. Please explain the internal mechanism of Kong 3.7. In Kong 1.5.1, the previous code works correctly. |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I’m experiencing an issue with Kong 3.7 where headers accessed via kong.request.get_header and ngx.var.http_xxx in the access phase are returning nil. As a result, when I try to set these headers using kong.service.request.set_header, they remain nil.
Could anyone explain why this might be happening? Are there specific handling steps I need to follow to resolve this issue?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions