fix: Make identifier for rate limit URL safe (#25111)

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