From d4d282c9ae6338efa14905234214c7f6a18e2bf8 Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Wed, 29 Nov 2017 14:26:17 -0500 Subject: [PATCH] in development version of render may return application/json --- lib/method.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/method.js b/lib/method.js index 586adac..6fc0278 100644 --- a/lib/method.js +++ b/lib/method.js @@ -119,8 +119,9 @@ module.exports = function(data, key) { function done(err, res) { var result; - if (!data.isBinary) { - result = data.isJSON ? res.body : res.text; + var isJSON = res.headers['content-type'] === 'application/json'; + if (!data.isBinary || isJSON) { + result = data.isJSON || isJSON ? res.body : res.text; callback(null, result); resolve(result); } else {