Skip to content

Commit

Permalink
use globals if they exist
Browse files Browse the repository at this point in the history
solves #860
  • Loading branch information
JakeChampion committed Jul 18, 2023
1 parent 7d92dff commit dffc542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Expand Up @@ -589,7 +589,7 @@ export function fetch(input, init) {
}
}

if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
Object.getOwnPropertyNames(init.headers).forEach(function(name) {
xhr.setRequestHeader(name, normalizeValue(init.headers[name]))
})
Expand Down

0 comments on commit dffc542

Please sign in to comment.