mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-22 19:09:00 +02: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,
|
||||
}));
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.post('/', (req, res, next) => {
|
||||
if (!env.turnstileSecret || !env.jwtSecret) {
|
||||
return next();
|
||||
@ -140,9 +143,6 @@ export const runAPI = (express, app, __dirname) => {
|
||||
next();
|
||||
});
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.use('/', express.json({ limit: 1024 }));
|
||||
app.use('/', (err, _, res, next) => {
|
||||
if (err) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user