mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Fix 400 error on resumable re-upload
This commit is contained in:
parent
926c3f2b37
commit
6bd160a68d
3 changed files with 11 additions and 12 deletions
|
@ -1,8 +1,7 @@
|
|||
import cors from 'cors'
|
||||
import express from 'express'
|
||||
|
||||
import { logger } from '@server/helpers/logger'
|
||||
import { HttpStatusCode } from '../../../shared/models'
|
||||
import { badRequest } from '../../helpers/express-utils'
|
||||
import { abuseRouter } from './abuse'
|
||||
import { accountsRouter } from './accounts'
|
||||
import { blocklistRouter } from './blocklist'
|
||||
|
@ -64,3 +63,11 @@ export { apiRouter }
|
|||
function pong (req: express.Request, res: express.Response) {
|
||||
return res.send('pong').status(HttpStatusCode.OK_200).end()
|
||||
}
|
||||
|
||||
function badRequest (req: express.Request, res: express.Response) {
|
||||
logger.debug(`API express handler not found: bad PeerTube request for ${req.method} - ${req.originalUrl}`)
|
||||
|
||||
return res.type('json')
|
||||
.status(HttpStatusCode.BAD_REQUEST_400)
|
||||
.end()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue