Skip to content

Commit

Permalink
Merge pull request JakeChampion#289 from steveluscher/patch-1
Browse files Browse the repository at this point in the history
Guard against `xhr.getAllResponseHeaders()` being `null`
  • Loading branch information
dgraham committed Mar 30, 2016
2 parents cff0ebb + 78b3a3b commit 08fc999
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@

function headers(xhr) {
var head = new Headers()
var pairs = xhr.getAllResponseHeaders().trim().split('\n')
var pairs = (xhr.getAllResponseHeaders() || '').trim().split('\n')
pairs.forEach(function(header) {
var split = header.trim().split(':')
var key = split.shift().trim()
Expand Down

0 comments on commit 08fc999

Please sign in to comment.