diff --git a/lib/pxproxy.js b/lib/pxproxy.js index f0ea252c..cd306681 100644 --- a/lib/pxproxy.js +++ b/lib/pxproxy.js @@ -236,10 +236,14 @@ function parseBody(req) { length: req.headers['content-length'], limit: '1mb', encoding: contentType.parse(req).parameters.charset - }, function (err, string) { - req.rawBody = string.toString(); - resolve(); - }); + }, function (err, string) { + if (err) { + pxLogger.debug(`Could not parse raw request body. limit: ${err.limit} encoding: ${err.encoding} status: ${err.status} error type: ${err.type}`); + return resolve(); + } + req.rawBody = string.toString(); + resolve(); + }); } else { if (typeof(req.body) === 'object') { if (req.headers['content-type'] === 'application/json') {