From 56c195a899f9cc756b8e467bc51892445f18254b Mon Sep 17 00:00:00 2001 From: Harprit Singh Chhabada <60806833+hchhabada@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:13:43 -0700 Subject: [PATCH] Update index.js --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 7fd2492..9b06286 100644 --- a/src/index.js +++ b/src/index.js @@ -689,9 +689,9 @@ function parseData (request, state) { state.body = state.body.substr(5); } - state.body = decodeURIComponent(state.body); - + if (request.headers['content-type'] === 'text/plain') { + state.body = decodeURIComponent(state.body); return JSON.parse(state.body); }