mirror of https://github.com/Chocobozzz/PeerTube
Prevent exception when headers are already sent
parent
3f9f1bceb6
commit
848347f193
|
@ -18,7 +18,10 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e
|
|||
})
|
||||
|
||||
res.status(status)
|
||||
|
||||
if (!res.headersSent) {
|
||||
res.setHeader('Content-Type', 'application/problem+json')
|
||||
}
|
||||
|
||||
const json = new ProblemDocument({
|
||||
status,
|
||||
|
|
Loading…
Reference in New Issue