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,
|
...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…
x
Reference in New Issue
Block a user