fix: fix the ratelimit bug for 2023 (#1316)

fredrikliu 1 year ago committed by Haotian Zhang
parent c35d4e2d15
commit 8372b35bac

@ -7,4 +7,5 @@
- [feat: add lane router examples](https://github.com/Tencent/spring-cloud-tencent/pull/1260)
- [feat:upgrade jackson version.](https://github.com/Tencent/spring-cloud-tencent/pull/1262)
- [fix: fix the lossless provider override in multiple registries scenario](https://github.com/Tencent/spring-cloud-tencent/pull/1263)
- [fix:fix nearby router properties loading bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1272)
- [fix:fix nearby router properties loading bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1272)
- [fix:fix the ratelimit bug for 2023](https://github.com/Tencent/spring-cloud-tencent/pull/1316)

@ -127,12 +127,12 @@ public class QuotaCheckReactiveFilter implements WebFilter, Ordered {
if (Objects.nonNull(quotaResponse.getActiveRule())) {
try {
String encodedActiveRuleName = URLEncoder.encode(
quotaResponse.getActiveRule().getName().getValue(), UTF_8);
quotaResponse.getActiveRuleName(), UTF_8);
response.getHeaders().add(HeaderConstant.INTERNAL_ACTIVE_RULE_NAME, encodedActiveRuleName);
}
catch (UnsupportedEncodingException e) {
LOG.error("Cannot encode {} for header internal-callee-activerule.",
quotaResponse.getActiveRule().getName().getValue(), e);
quotaResponse.getActiveRuleName(), e);
}
}
return response.writeWith(Mono.just(dataBuffer));

@ -119,12 +119,12 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter {
if (Objects.nonNull(quotaResponse.getActiveRule())) {
try {
String encodedActiveRuleName = URLEncoder.encode(
quotaResponse.getActiveRule().getName().getValue(), UTF_8);
quotaResponse.getActiveRuleName(), UTF_8);
response.addHeader(HeaderConstant.INTERNAL_ACTIVE_RULE_NAME, encodedActiveRuleName);
}
catch (UnsupportedEncodingException e) {
LOG.error("Cannot encode {} for header internal-callee-activerule.",
quotaResponse.getActiveRule().getName().getValue(), e);
quotaResponse.getActiveRuleName(), e);
}
}
return;

Loading…
Cancel
Save