thats not a possible header anymore
This commit is contained in:
parent
8f67b0ca75
commit
ddc1bf72d6
|
|
@ -16,7 +16,7 @@ const limiter = new RedisRateLimiter({
|
|||
})
|
||||
|
||||
app.get('/search', async ({ headers, query: { search }, set, redirect, error }) => {
|
||||
const hash = Bun.hash(headers['x-userip'] || headers['cf-connecting-ip'] || '0.0.0.0')
|
||||
const hash = Bun.hash(headers['cf-connecting-ip'] || '0.0.0.0')
|
||||
const isLimited = await limiter.limit(hash.toString())
|
||||
if (isLimited) return error(429, 'You have been ratelimited.')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue