mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Update torrents info name on video update
This commit is contained in:
parent
9b293cd6a2
commit
38d69d6501
4 changed files with 18 additions and 8 deletions
|
@ -1,5 +1,6 @@
|
|||
import express from 'express'
|
||||
import { ProblemDocument, ProblemDocumentExtension } from 'http-problem-details'
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { HttpStatusCode } from '@shared/models'
|
||||
|
||||
function apiFailMiddleware (req: express.Request, res: express.Response, next: express.NextFunction) {
|
||||
|
@ -18,7 +19,8 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e
|
|||
|
||||
res.status(status)
|
||||
res.setHeader('Content-Type', 'application/problem+json')
|
||||
res.json(new ProblemDocument({
|
||||
|
||||
const json = new ProblemDocument({
|
||||
status,
|
||||
title,
|
||||
instance,
|
||||
|
@ -28,7 +30,11 @@ function apiFailMiddleware (req: express.Request, res: express.Response, next: e
|
|||
type: type
|
||||
? `https://docs.joinpeertube.org/api-rest-reference.html#section/Errors/${type}`
|
||||
: undefined
|
||||
}, extension))
|
||||
}, extension)
|
||||
|
||||
logger.debug('Bad HTTP request.', { json })
|
||||
|
||||
res.json(json)
|
||||
}
|
||||
|
||||
if (next) next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue