aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/index.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-29 11:35:25 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 11:35:25 +0200
commit6bd160a68dac55f61b28c7631f9985320daf7755 (patch)
tree8fa98847ef4e374f37a072a91e1eb804001b5fc7 /server/controllers/api/index.ts
parent926c3f2b377196af1e8c5725aa54b8077cb79061 (diff)
downloadPeerTube-6bd160a68dac55f61b28c7631f9985320daf7755.tar.gz
PeerTube-6bd160a68dac55f61b28c7631f9985320daf7755.tar.zst
PeerTube-6bd160a68dac55f61b28c7631f9985320daf7755.zip
Fix 400 error on resumable re-upload
Diffstat (limited to 'server/controllers/api/index.ts')
-rw-r--r--server/controllers/api/index.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 31f1a56f9..38bd135d0 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -1,8 +1,7 @@
1import cors from 'cors' 1import cors from 'cors'
2import express from 'express' 2import express from 'express'
3 3import { logger } from '@server/helpers/logger'
4import { HttpStatusCode } from '../../../shared/models' 4import { HttpStatusCode } from '../../../shared/models'
5import { badRequest } from '../../helpers/express-utils'
6import { abuseRouter } from './abuse' 5import { abuseRouter } from './abuse'
7import { accountsRouter } from './accounts' 6import { accountsRouter } from './accounts'
8import { blocklistRouter } from './blocklist' 7import { blocklistRouter } from './blocklist'
@@ -64,3 +63,11 @@ export { apiRouter }
64function pong (req: express.Request, res: express.Response) { 63function pong (req: express.Request, res: express.Response) {
65 return res.send('pong').status(HttpStatusCode.OK_200).end() 64 return res.send('pong').status(HttpStatusCode.OK_200).end()
66} 65}
66
67function badRequest (req: express.Request, res: express.Response) {
68 logger.debug(`API express handler not found: bad PeerTube request for ${req.method} - ${req.originalUrl}`)
69
70 return res.type('json')
71 .status(HttpStatusCode.BAD_REQUEST_400)
72 .end()
73}