Browse Source

Fix incorrect header type #290

Ben Hsieh 7 years ago
parent
commit
f451a2c3a3
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      index.js

+ 4
- 1
index.js View File

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)) {