diff --git a/fetch.js b/fetch.js index c70622cf..9088c484 100644 --- a/fetch.js +++ b/fetch.js @@ -596,9 +596,16 @@ export function fetch(input, init) { } if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { + var names = []; Object.getOwnPropertyNames(init.headers).forEach(function(name) { + names.push(normalizeName(name)) xhr.setRequestHeader(name, normalizeValue(init.headers[name])) }) + request.headers.forEach(function(value, name) { + if (names.indexOf(name) === -1) { + xhr.setRequestHeader(name, value) + } + }) } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value)