fix: skip JSON body parsing for filebrowser upload routes
express.json() middleware was consuming the binary file body before the upload handler could drain it, causing 404/parse errors on file uploads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7aa59d8072
commit
dbd4cf59d2
@ -40,7 +40,13 @@ const corsOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app.use(cors(corsOptions))
|
app.use(cors(corsOptions))
|
||||||
app.use(express.json({ limit: '50mb' }))
|
// Skip JSON body parsing for filebrowser upload routes (binary file bodies)
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
if (req.path.startsWith('/app/filebrowser/api/resources') && req.method === 'POST') {
|
||||||
|
return next()
|
||||||
|
}
|
||||||
|
express.json({ limit: '50mb' })(req, res, next)
|
||||||
|
})
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
|
|
||||||
// Mock session storage
|
// Mock session storage
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user