From f451a2c3a3353de74afc997b937517731f914db1 Mon Sep 17 00:00:00 2001 From: Ben Hsieh Date: Mon, 20 Mar 2017 17:57:39 +0800 Subject: [PATCH] Fix incorrect header type #290 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ae240496e..0f68fa2e1 100644 --- a/index.js +++ b/index.js @@ -220,7 +220,10 @@ function fetch(...args:any):Promise { // # 241 normalize null or undefined headers, in case nil or null string // pass to native context - headers = _.map(headers, (h) => h || '' ); + headers = _.reduce(headers, (result, value, key) => { + result[key] = value || '' + return result + }, {}); // fetch from file system if(URIUtil.isFileURI(url)) {