From 87fe39736d9b74b9e59598619a75c7c2a58bcac1 Mon Sep 17 00:00:00 2001 From: Chok Yip Date: Fri, 10 Jun 2016 19:20:59 -0500 Subject: [PATCH] binary request for static maps --- lib/utils/makeRequest.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/makeRequest.js b/lib/utils/makeRequest.js index c539ed2..c0d05e8 100644 --- a/lib/utils/makeRequest.js +++ b/lib/utils/makeRequest.js @@ -71,7 +71,9 @@ module.exports = function(request, config, path, args, callback, encoding) { uri: (secure ? 'https' : 'http') + '://maps.googleapis.com' + path }; - if (encoding) options.encoding = encoding; + if (encoding) { + options.encoding = (encoding=='binary')?null:encoding; + } if (config.proxy) options.proxy = config.proxy; if (typeof callback !== 'function') {