api/core: move ratelimiters before authentication handler
This commit is contained in:
parent
3317726afe
commit
57c9836f56
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue