-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: pkgHTTP.Request RespHeader() Add override previous value #74
Comments
Codes here should take multiple header with same name into account |
Very good idea. I'll give it a try. |
Currently in Runner, headers are stored using map, which does not support repeated header settings, which may require us to extend the header key. If you have better ideas, you can always reply here. cc @goxiaoy |
So it is a common use case for set multiple header with same name like
local len = rewrite:RespHeadersLength()
if len > 0 then
for i = 1, len do
local entry = rewrite:RespHeaders(i)
local name = entry:Name()
if exclude_resp_header[str_lower(name)] == nil then
- core.response.set_header(name, entry:Value())
+ core.response.add_header(name, entry:Value())
end
end
end Might fix this bug |
@shuaijinchao I've tested the code above and it worked. But I'm not sure if |
You are right, after verification I found no abnormality, @spacewander what do you think? |
The |
|
The problem still exists, not solved |
@jthann upgrade apisix to 2.14.0 or newer |
Issue description
Cookie
a
is missing in the response headerEnvironment
uname -a
): centosMinimal test code / Steps to reproduce the issue
a
is missing in the response headerWhat's the actual result? (including assertion message & call stack if applicable)
Cookie
b
can be found, Cookiea
is missingWhat's the expected result?
Both cookie
a
andb
could be foundThe text was updated successfully, but these errors were encountered: