mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
style: fixed eslint
This commit is contained in:
parent
2bfc83e150
commit
82270b4f17
@ -12,14 +12,14 @@ const limiter = rateLimit({
|
|||||||
statusCode: 429,
|
statusCode: 429,
|
||||||
handler: (_req, res) => ResponseWrapper(res, { code: 429 }),
|
handler: (_req, res) => ResponseWrapper(res, { code: 429 }),
|
||||||
keyGenerator: (req) => req.headers.authorization,
|
keyGenerator: (req) => req.headers.authorization,
|
||||||
skip: (req) => {
|
skip: (req) => {
|
||||||
if(!req.headers.authorization) return true
|
if(!req.headers.authorization) return true
|
||||||
else return false
|
else return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const BotStats = RequestHandler()
|
const BotStats = RequestHandler()
|
||||||
.post(limiter)
|
.post(limiter)
|
||||||
.post(async (req: PostApiRequest, res) => {
|
.post(async (req: PostApiRequest, res) => {
|
||||||
const bot = await get.BotAuthorization(req.headers.token)
|
const bot = await get.BotAuthorization(req.headers.token)
|
||||||
if(!bot) return ResponseWrapper(res, { code: 401 })
|
if(!bot) return ResponseWrapper(res, { code: 401 })
|
||||||
|
|||||||
@ -12,10 +12,10 @@ const limiter = rateLimit({
|
|||||||
statusCode: 429,
|
statusCode: 429,
|
||||||
handler: (_req, res) => ResponseWrapper(res, { code: 429 }),
|
handler: (_req, res) => ResponseWrapper(res, { code: 429 }),
|
||||||
keyGenerator: (req) => req.headers.authorization,
|
keyGenerator: (req) => req.headers.authorization,
|
||||||
skip: (req) => {
|
skip: (req) => {
|
||||||
if(!req.headers.authorization) return true
|
if(!req.headers.authorization) return true
|
||||||
else return false
|
else return false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const BotStats = RequestHandler().post(limiter)
|
const BotStats = RequestHandler().post(limiter)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user