diff --git a/src/api/server.ts b/src/api/server.ts index 75f9943ee..390032f9a 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 52b3c952e..050a54240 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()); /**