aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/metrics.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-20 14:17:34 +0200
committerChocobozzz <me@florianbigard.com>2023-06-20 14:17:34 +0200
commite915cde30ec47258a2beeec5ca748c928b59858c (patch)
treef5692ab20c534a61487f3bd471bb6105ed58d88a /server/controllers/api/metrics.ts
parent923e41fa4f342019298b46e407ea1f0207f74205 (diff)
downloadPeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.tar.gz
PeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.tar.zst
PeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.zip
Fix runner api rate limit bypass
Diffstat (limited to 'server/controllers/api/metrics.ts')
-rw-r--r--server/controllers/api/metrics.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/metrics.ts b/server/controllers/api/metrics.ts
index f66173875..909963fa7 100644
--- a/server/controllers/api/metrics.ts
+++ b/server/controllers/api/metrics.ts
@@ -1,11 +1,13 @@
1import express from 'express' 1import express from 'express'
2import { CONFIG } from '@server/initializers/config'
2import { OpenTelemetryMetrics } from '@server/lib/opentelemetry/metrics' 3import { OpenTelemetryMetrics } from '@server/lib/opentelemetry/metrics'
3import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models' 4import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models'
4import { addPlaybackMetricValidator, asyncMiddleware } from '../../middlewares' 5import { addPlaybackMetricValidator, apiRateLimiter, asyncMiddleware } from '../../middlewares'
5import { CONFIG } from '@server/initializers/config'
6 6
7const metricsRouter = express.Router() 7const metricsRouter = express.Router()
8 8
9metricsRouter.use(apiRateLimiter)
10
9metricsRouter.post('/playback', 11metricsRouter.post('/playback',
10 asyncMiddleware(addPlaybackMetricValidator), 12 asyncMiddleware(addPlaybackMetricValidator),
11 addPlaybackMetric 13 addPlaybackMetric