|
|
@ -13,6 +13,7 @@
|
|
|
|
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
|
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations under the License.
|
|
|
|
* specific language governing permissions and limitations under the License.
|
|
|
|
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package com.tencent.cloud.polaris.ratelimit.filter;
|
|
|
|
package com.tencent.cloud.polaris.ratelimit.filter;
|
|
|
@ -76,8 +77,7 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter {
|
|
|
|
localNamespace, localService, 1, labels, null);
|
|
|
|
localNamespace, localService, 1, labels, null);
|
|
|
|
if (quotaResponse.getCode() == QuotaResultCode.QuotaResultLimited) {
|
|
|
|
if (quotaResponse.getCode() == QuotaResultCode.QuotaResultLimited) {
|
|
|
|
response.setStatus(TOO_MANY_REQUESTS.value());
|
|
|
|
response.setStatus(TOO_MANY_REQUESTS.value());
|
|
|
|
response.getWriter().write(
|
|
|
|
response.getWriter().write(RateLimitConstant.QUOTA_LIMITED_INFO);
|
|
|
|
RateLimitConstant.QUOTA_LIMITED_INFO + quotaResponse.getInfo());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
filterChain.doFilter(request, response);
|
|
|
|
filterChain.doFilter(request, response);
|
|
|
|