mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 17:38:31 +00:00
api/core: move ratelimiters before authentication handler
This commit is contained in:
parent
3317726afe
commit
57c9836f56
@ -102,6 +102,9 @@ export const runAPI = (express, app, __dirname) => {
|
|||||||
...corsConfig,
|
...corsConfig,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
app.post('/', apiLimiter);
|
||||||
|
app.use('/tunnel', apiLimiterStream);
|
||||||
|
|
||||||
app.post('/', (req, res, next) => {
|
app.post('/', (req, res, next) => {
|
||||||
if (!env.turnstileSecret || !env.jwtSecret) {
|
if (!env.turnstileSecret || !env.jwtSecret) {
|
||||||
return next();
|
return next();
|
||||||
@ -140,9 +143,6 @@ export const runAPI = (express, app, __dirname) => {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.post('/', apiLimiter);
|
|
||||||
app.use('/tunnel', apiLimiterStream);
|
|
||||||
|
|
||||||
app.use('/', express.json({ limit: 1024 }));
|
app.use('/', express.json({ limit: 1024 }));
|
||||||
app.use('/', (err, _, res, next) => {
|
app.use('/', (err, _, res, next) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user