Merge pull request #802 from navi-infra/INFRA-2824-ratelimit-headername

INFRA-2824 | Harinder | Bug fix: Kong rate limit config was incorrect in case a user was doing rate limit on header
This commit is contained in:
Harinder Singh
2024-02-08 11:35:09 +05:30
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -1175,7 +1175,7 @@
{ {
"apiVersion": "configuration.konghq.com/v1", "apiVersion": "configuration.konghq.com/v1",
"config": { "config": {
"header": "hello-world", "header_name": "hello-world",
"limit_by": "header", "limit_by": "header",
"minute": 60 "minute": 60
}, },

View File

@@ -163,7 +163,7 @@ local create_kong_rate_limiter(environment, servicePrefix, typeIdentifier, gatew
minute: rule.limit, minute: rule.limit,
limit_by: '%s' % rule.options, limit_by: '%s' % rule.options,
[if rule.options == 'path' then 'path' else null]: '%s' % forTheGateway, [if rule.options == 'path' then 'path' else null]: '%s' % forTheGateway,
[if rule.options == 'header' then 'header' else null]: '%s' % rule.header, [if rule.options == 'header' then 'header_name' else null]: '%s' % rule.header,
}, },
} for rule in rateLimitRules], } for rule in rateLimitRules],
}; };