diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-29 11:35:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 11:35:25 +0200 |
commit | 6bd160a68dac55f61b28c7631f9985320daf7755 (patch) | |
tree | 8fa98847ef4e374f37a072a91e1eb804001b5fc7 /server/controllers/api/index.ts | |
parent | 926c3f2b377196af1e8c5725aa54b8077cb79061 (diff) | |
download | PeerTube-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.ts | 11 |
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 @@ | |||
1 | import cors from 'cors' | 1 | import cors from 'cors' |
2 | import express from 'express' | 2 | import express from 'express' |
3 | 3 | import { logger } from '@server/helpers/logger' | |
4 | import { HttpStatusCode } from '../../../shared/models' | 4 | import { HttpStatusCode } from '../../../shared/models' |
5 | import { badRequest } from '../../helpers/express-utils' | ||
6 | import { abuseRouter } from './abuse' | 5 | import { abuseRouter } from './abuse' |
7 | import { accountsRouter } from './accounts' | 6 | import { accountsRouter } from './accounts' |
8 | import { blocklistRouter } from './blocklist' | 7 | import { blocklistRouter } from './blocklist' |
@@ -64,3 +63,11 @@ export { apiRouter } | |||
64 | function pong (req: express.Request, res: express.Response) { | 63 | function 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 | |||
67 | function 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 | } | ||