File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4508,25 +4508,24 @@ func parseCommandPolicies(commandInfoTips map[string]string) *routing.CommandPol
45084508 req := routing .ReqDefault
45094509 resp := routing .RespAllSucceeded
45104510
4511- if commandInfoTips != nil {
4512- if v , ok := commandInfoTips [requestPolicy ]; ok {
4511+
4512+ tips := make (map [string ]string , len (commandInfoTips ))
4513+ for k , v := range commandInfoTips {
4514+ if k == requestPolicy {
45134515 if p , err := routing .ParseRequestPolicy (v ); err == nil {
45144516 req = p
45154517 }
4518+ continue
45164519 }
4517- if v , ok := commandInfoTips [ responsePolicy ]; ok {
4520+ if k == responsePolicy {
45184521 if p , err := routing .ParseResponsePolicy (v ); err == nil {
45194522 resp = p
45204523 }
4521- }
4522- }
4523- tips := make (map [string ]string , len (commandInfoTips ))
4524- for k , v := range commandInfoTips {
4525- if k == requestPolicy || k == responsePolicy {
45264524 continue
45274525 }
45284526 tips [k ] = v
45294527 }
4528+
45304529 return & routing.CommandPolicy {Request : req , Response : resp , Tips : tips }
45314530}
45324531
You can’t perform that action at this time.
0 commit comments