mscb402 commented on code in PR #8904:
URL: https://github.com/apache/apisix/pull/8904#discussion_r1115163363


##########
apisix/consumer.lua:
##########
@@ -88,6 +88,11 @@ function _M.attach_consumer(ctx, consumer, conf)
     ctx.consumer_ver = conf.conf_version
 end
 
+-- attach chosen consumer to the request headers, used in auth plugin
+function _M.attach_consumer_to_request(ctx, req, consumer)
+    req.set_header(ctx, "X-Consumer-Name", consumer.consumer_name)
+    req.set_header(ctx, "X-Consumer-Group-ID", consumer.group_id)

Review Comment:
   Yes. Of course, users can use proxy-rewrite to implement it, but if APISIX 
supports adding the name directly to the header, the difference is more 
convenient.



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