From 1fe0b8aaae9d6566c29bcd525b923978cdc84a3f Mon Sep 17 00:00:00 2001 From: i832513 Date: Fri, 15 Oct 2021 22:40:30 -0700 Subject: [PATCH] fix: sendProxyRequest contentType can contain semi-colon --- app/steps/sendProxyRequest.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/steps/sendProxyRequest.js b/app/steps/sendProxyRequest.js index 6764ecfb..b566d25f 100644 --- a/app/steps/sendProxyRequest.js +++ b/app/steps/sendProxyRequest.js @@ -50,6 +50,12 @@ function sendProxyRequest(Container) { if (bodyContent.length) { var body = bodyContent; var contentType = proxyReq.getHeader('Content-Type'); + var scIndex = contentType ? contentType.indexOf(';') : -1; + if (scIndex >= 0) { + // contentTypes may contain semi-colon + // example: "application/x-www-form-urlencoded; charset=UTF-8" + contentType = contentType.substring(0, scIndex); + } if (contentType === 'x-www-form-urlencoded' || contentType === 'application/x-www-form-urlencoded') { try { var params = JSON.parse(body);