瀏覽代碼

Fix incorrect header type #290

Ben Hsieh 7 年之前
父節點
當前提交
f451a2c3a3
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      index.js

+ 4
- 1
index.js 查看文件

@@ -220,7 +220,10 @@ function fetch(...args:any):Promise {
220 220
 
221 221
   // # 241 normalize null or undefined headers, in case nil or null string
222 222
   // pass to native context
223
-  headers = _.map(headers, (h) => h || '' );
223
+  headers = _.reduce(headers, (result, value, key) => {
224
+    result[key] = value || ''
225
+    return result
226
+  }, {});
224 227
 
225 228
   // fetch from file system
226 229
   if(URIUtil.isFileURI(url)) {