monkeyDluffy6017 commented on code in PR #8824:
URL: https://github.com/apache/apisix/pull/8824#discussion_r1113806185


##########
apisix/core/request.lua:
##########
@@ -131,26 +128,36 @@ function _M.set_header(ctx, header_name, header_value)
         changed = a6_request.is_request_header_set()
     end
 
-    ngx.req.set_header(header_name, header_value)
+    update_func(header_name, header_value)
 
     if is_apisix_or and not changed then
         -- if the headers are not changed before,
         -- we can only update part of the cache instead of invalidating the 
whole
         a6_request.clear_request_header()
         if ctx and ctx.headers then
-            ctx.headers[header_name] = header_value
+            if override or not ctx.headers[header_name] then
+                ctx.headers[header_name] = header_value
+            else
+                ctx.headers[header_name] = ctx.headers[header_name] .. 
header_value

Review Comment:
   I think it is not corrent.
   request headers like this:
   ```
    Foo: foo
    Foo: bar
    Foo: baz
   ```
   will be a lua table like this:
   ```
    {"foo", "bar", "baz"}
   ```



-- 
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]

Reply via email to