@@ -345,7 +345,7 @@ func BuildRateLimitDescriptors(rule *traffic_manage.Rule) ([]*route.RateLimit_Ac
345
345
Value : arg .GetValue ().GetValue ().GetValue (),
346
346
})
347
347
case apitraffic .MatchArgument_QUERY :
348
- queryParameterValueMatch := BuildRateLimitActionQueryParameterValueMatch (descriptorKey , arg . Value )
348
+ queryParameterValueMatch := BuildRateLimitActionQueryParameterValueMatch (descriptorKey , arg )
349
349
actions = append (actions , & route.RateLimit_Action {
350
350
ActionSpecifier : & route.RateLimit_Action_QueryParameterValueMatch_ {
351
351
QueryParameterValueMatch : queryParameterValueMatch ,
@@ -392,22 +392,22 @@ func BuildRateLimitDescriptors(rule *traffic_manage.Rule) ([]*route.RateLimit_Ac
392
392
}
393
393
394
394
func BuildRateLimitActionQueryParameterValueMatch (key string ,
395
- value * apimodel. MatchString ) * route.RateLimit_Action_QueryParameterValueMatch {
395
+ arg * apitraffic. MatchArgument ) * route.RateLimit_Action_QueryParameterValueMatch {
396
396
queryParameterValueMatch := & route.RateLimit_Action_QueryParameterValueMatch {
397
397
DescriptorKey : key ,
398
- DescriptorValue : value .GetValue ().GetValue (),
398
+ DescriptorValue : arg . GetValue () .GetValue ().GetValue (),
399
399
ExpectMatch : wrapperspb .Bool (true ),
400
400
QueryParameters : []* route.QueryParameterMatcher {},
401
401
}
402
- switch value .GetType () {
402
+ switch arg . GetValue () .GetType () {
403
403
case apimodel .MatchString_EXACT :
404
404
queryParameterValueMatch .QueryParameters = []* route.QueryParameterMatcher {
405
405
{
406
- Name : key ,
406
+ Name : arg . GetKey () ,
407
407
QueryParameterMatchSpecifier : & route.QueryParameterMatcher_StringMatch {
408
408
StringMatch : & v32.StringMatcher {
409
409
MatchPattern : & v32.StringMatcher_Exact {
410
- Exact : value .GetValue ().GetValue (),
410
+ Exact : arg . GetValue () .GetValue ().GetValue (),
411
411
},
412
412
},
413
413
},
@@ -416,13 +416,13 @@ func BuildRateLimitActionQueryParameterValueMatch(key string,
416
416
case apimodel .MatchString_REGEX :
417
417
queryParameterValueMatch .QueryParameters = []* route.QueryParameterMatcher {
418
418
{
419
- Name : key ,
419
+ Name : arg . GetKey () ,
420
420
QueryParameterMatchSpecifier : & route.QueryParameterMatcher_StringMatch {
421
421
StringMatch : & v32.StringMatcher {
422
422
MatchPattern : & v32.StringMatcher_SafeRegex {
423
423
SafeRegex : & v32.RegexMatcher {
424
424
EngineType : & v32.RegexMatcher_GoogleRe2 {},
425
- Regex : value .GetValue ().GetValue (),
425
+ Regex : arg . GetValue () .GetValue ().GetValue (),
426
426
},
427
427
},
428
428
},
0 commit comments