From 680f9a0b5c36d0ee459526a36419c5a5afd7b1e0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Feb 2017 02:18:58 +0900 Subject: [PATCH] =?UTF-8?q?[Server]=20text/plain=E3=81=AE=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=82=82JSON=E3=81=A8=E3=81=97=E3=81=A6=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/server.ts | 4 +++- src/web/server.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) 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()); /**