mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-04 22:16:28 +01:00
Skip urlencoded body parsing for internal-api routes
This commit is contained in:
1 parent
b7ead7a316
commit
938fd36b1d
1 file changed
+2
-4
+2
-4
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user