Browse Source

Fix #229 immutable HTTP headers issue

Ben Hsieh 7 years ago
parent
commit
327bbc68ba
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      index.js

+ 1
- 3
index.js View File

@@ -220,9 +220,7 @@ 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
-  _.each(headers, (h,i) =>  {
224
-    headers[i] = h || ''
225
-  });
223
+  headers = _.map(headers, (h) => h || '' );
226 224
 
227 225
   // fetch from file system
228 226
   if(URIUtil.isFileURI(url)) {