mirror of
https://github.com/wukko/cobalt.git
synced 2025-06-13 05:37:44 +02:00
api/core: rename tunnel limiter, move to endpoint
This commit is contained in:
@ -81,7 +81,7 @@ export const runAPI = (express, app, __dirname) => {
|
||||
handler: handleRateExceeded
|
||||
})
|
||||
|
||||
const apiLimiterStream = rateLimit({
|
||||
const apiTunnelLimiter = rateLimit({
|
||||
windowMs: env.rateLimitWindow * 1000,
|
||||
max: env.rateLimitMax,
|
||||
standardHeaders: true,
|
||||
@ -105,8 +105,6 @@ export const runAPI = (express, app, __dirname) => {
|
||||
...corsConfig,
|
||||
}));
|
||||
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.post('/', (req, res, next) => {
|
||||
if (!acceptRegex.test(req.header('Accept'))) {
|
||||
return fail(res, "error.api.header.accept");
|
||||
@ -231,7 +229,7 @@ export const runAPI = (express, app, __dirname) => {
|
||||
}
|
||||
})
|
||||
|
||||
app.get('/tunnel', (req, res) => {
|
||||
app.get('/tunnel', apiTunnelLimiter, (req, res) => {
|
||||
const id = String(req.query.id);
|
||||
const exp = String(req.query.exp);
|
||||
const sig = String(req.query.sig);
|
||||
|
Reference in New Issue
Block a user