api/core: move ratelimiters before authentication handler

This commit is contained in:
dumbmoron 2024-09-09 14:21:15 +00:00
parent 3317726afe
commit 57c9836f56
No known key found for this signature in database

View file

@ -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) {