fix: Make identifier for rate limit URL safe (#25111)
This commit is contained in:
1 parent
cddd8d7d9d
commit
d4ef6e83cf
1 file changed
+1
-1
@@ -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