mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 04:39:58 +00:00
api/core: move api limiter after authentication
This commit is contained in:
parent
034f7ebe4a
commit
f2248d4e9a
1 changed files with 2 additions and 1 deletions
|
@ -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…
Reference in a new issue