fix: make identifier url safe 2 (#25112)

* fix: Make identifier for rate limit URL safe

* fix: Make identifier for rate limit URL safe using hasing
This commit is contained in:
Alex van Andel
2025-11-13 01:42:13 +00:00
committed by GitHub
parent d4ef6e83cf
commit 530cb94f0b
+1 -1
View File
@@ -101,7 +101,7 @@ const middleware = async (req: NextRequest): Promise<NextResponse<unknown>> => {
try {
await checkRateLimitAndThrowError({
rateLimitingType: "common",
identifier: `${encodeURIComponent(req.nextUrl.pathname)}-${piiHasher.hash(requestorIp)}`,
identifier: piiHasher.hash(`${req.nextUrl.pathname}-${requestorIp}`),
});
} catch (error) {
if (error instanceof HttpError) {