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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user