Skip to content

Commit e1849e2

Browse files
fredrikliufredrikliu
and
fredrikliu
authored
fix:fix the ratelimit bug for hoxton (#1301)
* add getActiveRuleName * add change log --------- Co-authored-by: fredrikliu <[email protected]>
1 parent 5566353 commit e1849e2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

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

spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckReactiveFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
128128
if (Objects.nonNull(quotaResponse.getActiveRule())) {
129129
try {
130130
String encodedActiveRuleName = URLEncoder.encode(
131-
quotaResponse.getActiveRule().getName().getValue(), UTF_8);
131+
quotaResponse.getActiveRuleName(), UTF_8);
132132
response.getHeaders().add(HeaderConstant.INTERNAL_ACTIVE_RULE_NAME, encodedActiveRuleName);
133133
}
134134
catch (UnsupportedEncodingException e) {
135135
LOG.error("Cannot encode {} for header internal-callee-activerule.",
136-
quotaResponse.getActiveRule().getName().getValue(), e);
136+
quotaResponse.getActiveRuleName(), e);
137137
}
138138
}
139139
return response.writeWith(Mono.just(dataBuffer));

spring-cloud-starter-tencent-polaris-ratelimit/src/main/java/com/tencent/cloud/polaris/ratelimit/filter/QuotaCheckServletFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull Ht
121121
if (Objects.nonNull(quotaResponse.getActiveRule())) {
122122
try {
123123
String encodedActiveRuleName = URLEncoder.encode(
124-
quotaResponse.getActiveRule().getName().getValue(), UTF_8);
124+
quotaResponse.getActiveRuleName(), UTF_8);
125125
response.addHeader(HeaderConstant.INTERNAL_ACTIVE_RULE_NAME, encodedActiveRuleName);
126126
}
127127
catch (UnsupportedEncodingException e) {
128128
LOG.error("Cannot encode {} for header internal-callee-activerule.",
129-
quotaResponse.getActiveRule().getName().getValue(), e);
129+
quotaResponse.getActiveRuleName(), e);
130130
}
131131
}
132132
return;

0 commit comments

Comments
 (0)