File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 88func DynamicMiddleware (next http.Handler ) http.Handler {
99 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
1010 if dynamicCacheClient != nil {
11- if token := getRequestParam ( r , headerToken , true ); token != "" {
11+ if token := r . Header . Get ( headerToken ); token != "" {
1212 ctx := context .WithValue (context .Background (), cacheClientCtxKey , dynamicCacheClient )
1313 r = r .Clone (ctx )
1414 r .URL .Query ().Set (headerToken , token )
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ func TrafficMiddleware(next http.Handler) http.Handler {
1313 } else {
1414 params := make ([]string , 4 )
1515 params = append (params , r .Method , r .URL .RequestURI ())
16- if token := getRequestParam ( r , headerToken , false ); token != "" {
16+ if token := r . Header . Get ( headerToken ); token != "" {
1717 params = append (params , token )
1818 }
19- if rg := getRequestParam ( r , headerToken , false ); rg != "" {
19+ if rg := r . Header . Get ( headerRange ); rg != "" {
2020 params = append (params , rg )
2121 }
2222 lockKey = strings .Join (params , ":" )
Original file line number Diff line number Diff line change 88func UserMiddleware (next http.Handler ) http.Handler {
99 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
1010 if userCacheClient != nil {
11- if token := getRequestParam ( r , headerToken , true ); token != "" {
11+ if token := r . Header . Get ( headerToken ); token != "" {
1212 ctx := context .WithValue (context .Background (), cacheClientCtxKey , userCacheClient )
1313 r = r .Clone (ctx )
1414 r .URL .Query ().Set (headerToken , token )
You can’t perform that action at this time.
0 commit comments