Skip urlencoded body parsing for internal-api routes

This commit is contained in:
mikiher committed 2026-12-03 05:28:49 +02:00
1 parent b7ead7a316
commit 938fd36b1d
1 file changed
+2 -4
+2 -4
View File
@@ -337,10 +337,8 @@ class Server {
this.server = http.createServer(app)
router.use(express.urlencoded({ extended: true, limit: '5mb' }))
// Skip JSON parsing for internal-api routes
router.use(/^(?!\/internal-api).*/, express.json({ limit: '10mb' }))
// Skip body parsing for internal-api routes so Next.js receives the unread request stream
router.use(/^(?!\/internal-api).*/, express.urlencoded({ extended: true, limit: '5mb' }), express.json({ limit: '10mb' }))
router.use('/api', this.auth.ifAuthNeeded(this.authMiddleware.bind(this)), this.apiRouter.router)
router.use('/hls', this.hlsRouter.router)