whatwg-fetch
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -427,10 +427,18 @@ (function (global, factory) { | ||
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); | ||
preProcessedHeaders.split(/\r?\n/).forEach(function(line) { | ||
var parts = line.split(':'); | ||
var key = parts.shift().trim(); | ||
if (key) { | ||
var value = parts.join(':').trim(); | ||
headers.append(key, value); | ||
} | ||
}); | ||
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill | ||
// https://github.com/github/fetch/issues/748 | ||
// https://github.com/zloirock/core-js/issues/751 | ||
preProcessedHeaders | ||
.split('\r') | ||
.map(function(header) { | ||
return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header | ||
}) | ||
.forEach(function(line) { | ||
var parts = line.split(':'); | ||
var key = parts.shift().trim(); | ||
if (key) { | ||
var value = parts.join(':').trim(); | ||
headers.append(key, value); | ||
} | ||
}); | ||
return headers | ||
@@ -437,0 +445,0 @@ } |
24
fetch.js
@@ -421,10 +421,18 @@ var global = | ||
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ') | ||
preProcessedHeaders.split(/\r?\n/).forEach(function(line) { | ||
var parts = line.split(':') | ||
var key = parts.shift().trim() | ||
if (key) { | ||
var value = parts.join(':').trim() | ||
headers.append(key, value) | ||
} | ||
}) | ||
// Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill | ||
// https://github.com/github/fetch/issues/748 | ||
// https://github.com/zloirock/core-js/issues/751 | ||
preProcessedHeaders | ||
.split('\r') | ||
.map(function(header) { | ||
return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header | ||
}) | ||
.forEach(function(line) { | ||
var parts = line.split(':') | ||
var key = parts.shift().trim() | ||
if (key) { | ||
var value = parts.join(':').trim() | ||
headers.append(key, value) | ||
} | ||
}) | ||
return headers | ||
@@ -431,0 +439,0 @@ } |
{ | ||
"name": "whatwg-fetch", | ||
"description": "A window.fetch polyfill.", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"main": "./dist/fetch.umd.js", | ||
@@ -6,0 +6,0 @@ "module": "./fetch.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54740
1065