spacewander commented on code in PR #8904:
URL: https://github.com/apache/apisix/pull/8904#discussion_r1115162236
##########
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:
Can't the user use proxy-rewrite to add them?
https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/proxy-rewrite.md
We support using variables in the header and we have these variables:
https://github.com/apache/apisix/blob/master/docs/en/latest/apisix-variable.md
--
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]