浏览代码

Fix incorrect header type #290

Ben Hsieh 8 年前
父节点
当前提交
f451a2c3a3
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      index.js

+ 4
- 1
index.js 查看文件

220
 
220
 
221
   // # 241 normalize null or undefined headers, in case nil or null string
221
   // # 241 normalize null or undefined headers, in case nil or null string
222
   // pass to native context
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
   // fetch from file system
228
   // fetch from file system
226
   if(URIUtil.isFileURI(url)) {
229
   if(URIUtil.isFileURI(url)) {