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:
auto committed 2025-04-18 18:33:47 +02:00
1 parent e3eaab708c
commit a01038e86c
2 files changed
+157 -33

No files matched your search

@@ -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))