mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-02 05:04:13 +01:00
Set text/plain content type for plain-text upload error responses
This commit is contained in:
1 parent
0afb582f09
commit
47bdd3d2dc
2 files changed
+23
No files matched your search
@@ -63,6 +63,7 @@ class MiscController {
|
||||
if (error instanceof uploadPath.UploadError) {
|
||||
Logger.warn(`[MiscController] User "${req.user.username}" upload failed (${error.statusCode}): ${error.message}`)
|
||||
if (error.body) return res.status(error.statusCode).json(error.body)
|
||||
res.type('text/plain')
|
||||
return res.status(error.statusCode).send(error.message)
|
||||
}
|
||||
return res.sendStatus(500)
|
||||
|
||||
Reference in new issue
Block a user