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,
|
...corsConfig,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
app.post('/', apiLimiter);
|
|
||||||
app.use('/tunnel', apiLimiterStream);
|
app.use('/tunnel', apiLimiterStream);
|
||||||
|
|
||||||
app.post('/', (req, res, next) => {
|
app.post('/', (req, res, next) => {
|
||||||
|
@ -148,7 +147,9 @@ export const runAPI = (express, app, __dirname) => {
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.post('/', apiLimiter);
|
||||||
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) {
|
||||||
const { status, body } = createResponse("error", {
|
const { status, body } = createResponse("error", {
|
||||||
|
|
Loading…
Reference in a new issue