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


##########
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:
   The Test 15 in `request.t` can cover this.



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