diff --git a/src/api/server.ts b/src/api/server.ts index 75f9943ee7..390032f9a4 100644 --- a/src/api/server.ts +++ b/src/api/server.ts @@ -18,7 +18,9 @@ const app = express(); app.disable('x-powered-by'); app.set('etag', false); app.use(bodyParser.urlencoded({ extended: true })); -app.use(bodyParser.json()); +app.use(bodyParser.json({ + type: ['application/json', 'text/plain'] +})); app.use(cors({ origin: true })); diff --git a/src/web/server.ts b/src/web/server.ts index 52b3c952ed..050a542407 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -21,6 +21,9 @@ const app = express(); app.disable('x-powered-by'); app.use(bodyParser.urlencoded({ extended: true })); +app.use(bodyParser.json({ + type: ['application/json', 'text/plain'] +})); app.use(compression()); /**