fix: Make identifier for rate limit URL safe (#25111)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user