mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 06:20:24 +00:00
feat: not caching for fallback image
This commit is contained in:
parent
fdef8c1eaf
commit
22a600a1e5
@ -16,6 +16,7 @@ const Avatar = nc<ApiRequest, NextApiResponse>()
|
||||
const ratelimited = RateLimitHandler(res, { used: rate, limit: 600, reset: (<any>imageRateLimit).scheduler.get(req.socket.remoteAddress).expiry, onLimitExceed: async(res) => {
|
||||
const img = await get.images.user.load(DiscordEnpoints.CDN.default(Math.floor(Math.random() * 6), { format: 'png' }))
|
||||
res.setHeader('Content-Type', 'image/png')
|
||||
res.setHeader('Cache-Control', 'no-cache')
|
||||
img.pipe(res)
|
||||
} })
|
||||
if(ratelimited) return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user