mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-21 15:47:06 +02:00
api/core: move api limiter after authentication
This commit is contained in:
parent
034f7ebe4a
commit
f2248d4e9a
@ -105,7 +105,6 @@ export const runAPI = (express, app, __dirname) => {
|
||||
...corsConfig,
|
||||
}));
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.post('/', (req, res, next) => {
|
||||
@ -148,7 +147,9 @@ export const runAPI = (express, app, __dirname) => {
|
||||
next();
|
||||
});
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/', express.json({ limit: 1024 }));
|
||||
|
||||
app.use('/', (err, _, res, next) => {
|
||||
if (err) {
|
||||
const { status, body } = createResponse("error", {
|
||||
|
Loading…
x
Reference in New Issue
Block a user