You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "mscb402 (via GitHub)" <gi...@apache.org> on 2023/02/23 01:28:58 UTC
[GitHub] [apisix] mscb402 commented on a diff in pull request #8904: feat: add consumer name to header
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org