fix:fix the ratelimit bug for hoxton (#1301)

* add getActiveRuleName

* add change log

---------

Co-authored-by: fredrikliu <fredrikliu@tencent.com>
pull/1302/head
fredrikliu 1 year ago committed by GitHub
parent 556635386a
commit e1849e27ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -12,3 +12,4 @@
- [feat: merge lane router and lossless features from 2023](https://github.com/Tencent/spring-cloud-tencent/pull/1288)
- [fix: fix npe when add circuitbreak module without feign.hystrix.enable=true](https://github.com/Tencent/spring-cloud-tencent/pull/1292)
- [fix:fix ApplicationContextAwareUtils NPE bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1295)
- [fix:fix the ratelimit bug for hoxton](https://github.com/Tencent/spring-cloud-tencent/pull/1301)

@ -128,12 +128,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));

@ -121,12 +121,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