liuhuihui01 opened a new issue #6738:
URL: https://github.com/apache/apisix/issues/6738


   ### Description
   
   业务背景:每个用户购买的套餐不一样,他访问系统的qpm,qps值不一样,所以我们需要在网关层加一个自定义插件,实现不同的用户,实现不一样的限流操作。
   
而我们的框架每个请求的鉴权参数ak(可以理解为用户id),都是在head里面传递,然后我们现在想实现一个自定义插件,获取到请求头的head里的ak参数,然后获取到他相应的套餐,然后进行限流限速操作,这样就不用每个服务都去写相关的限速限流逻辑,但是实现过程中发现,请求在header里传了ak信息,但是在Filter方法里面获取不到。
   func (p *LimitApiComboReq) Filter(conf interface{}, w http.ResponseWriter, r 
pkgHTTP.Request)  把 r request打印出来是没有看到请求头参数head有信息。请问要怎样才能获取到请求的header参数?
   
   ### Environment
   
   - APISIX version :2.12.1-alpine
   - Operating system (run `uname -a`):Linux DESKTOP-7STVTH7 
5.4.72-microsoft-standard-WSL2
   - OpenResty / Nginx  version :openresty/1.19.9.1:
   - etcd version : 3.4.5
   - LuaRocks version: 2.4.2
   


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