summary refs log tree commit diff
path: root/api/src/middlewares/BodyParser.ts
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/middlewares/BodyParser.ts')
-rw-r--r--api/src/middlewares/BodyParser.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/src/middlewares/BodyParser.ts b/api/src/middlewares/BodyParser.ts

index b0ff699d..4cb376bc 100644 --- a/api/src/middlewares/BodyParser.ts +++ b/api/src/middlewares/BodyParser.ts
@@ -6,6 +6,8 @@ export function BodyParser(opts?: OptionsJson) { const jsonParser = bodyParser.json(opts); return (req: Request, res: Response, next: NextFunction) => { + if (!req.headers["content-type"]) req.headers["content-type"] = "application/json"; + jsonParser(req, res, (err) => { if (err) { // TODO: different errors for body parser (request size limit, wrong body type, invalid body, ...)