From 1bf404fbd87ca4c8b9d98f18eff745544dedd02d Mon Sep 17 00:00:00 2001 From: Sajjad Hashemian Date: Fri, 27 Apr 2018 11:33:42 +0430 Subject: [PATCH] check `content-type` is `application/json` --- lib/log.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/log.js b/lib/log.js index bc80224..cd433a2 100644 --- a/lib/log.js +++ b/lib/log.js @@ -35,7 +35,7 @@ const logLine = (message, date) => { const logRequest = async ({ req, start, requestIndex, limit }) => { logLine(`> #${requestIndex} ${chalk.bold(req.method)} ${req.url}`, start) - if (req.headers['content-length'] > 0 && req.headers['content-type'] === 'application/json') { + if (req.headers['content-length'] > 0 && req.headers['content-type'].indexOf('application/json') === 0) { try { const parsedJson = await json(req, { limit }) jsome(parsedJson)