Refactor rate-limiting and name history queries.
Removed redundant rate-limit response headers and improved query methods for fetching punishment history. Refactored methods to handle cases where partial names are empty and added escaping for underscores in search names.
This commit is contained in:
@@ -71,13 +71,6 @@ public class RateLimitAspect {
|
||||
|
||||
Duration nextResetTime = rateLimiterService.getNextResetTime(key, duration);
|
||||
|
||||
if (response != null) {
|
||||
response.setStatus(HttpStatus.TOO_MANY_REQUESTS.value());
|
||||
response.setHeader("X-Rate-Limit-Limit", String.valueOf(limit));
|
||||
response.setHeader("X-Rate-Limit-Remaining", "0");
|
||||
response.setHeader("Retry-After", String.valueOf(nextResetTime.getSeconds()));
|
||||
}
|
||||
|
||||
return ResponseEntity
|
||||
.status(HttpStatus.TOO_MANY_REQUESTS)
|
||||
.header("X-Rate-Limit-Limit", String.valueOf(limit))
|
||||
|
||||
Reference in New Issue
Block a user