Skip to content

Commit 526ba3b

Browse files
author
subtype
committed
Merge branch 'rc-v1' into 'v1'
add better IP logging See merge request subtype/subspace-api!10
2 parents b012134 + 2c4f267 commit 526ba3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/rateLimiter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Response } from 'express'
66
export const rateLimiter: RateLimitRequestHandler = rateLimit({
77
windowMs: 60 * 1000,
88
limit: (req: Request): number => {
9-
logger.debug(`Rate limit check ${ req.auth ? 'authenticated' : 'anon' } - ${ req.ip }`)
9+
logger.debug(`Rate limit check ${ req.auth ? 'authenticated' : 'anon' } - ${ req.headers['cf-connecting-ip'] ?? req.ip }`)
1010
return req.auth ? 60 : 5 // 60 req/min for auth, 5 for anon
1111
},
1212
keyGenerator: (req: Request): string => {

0 commit comments

Comments
 (0)