Skip to content

Commit

Permalink
Resolves #928
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Champion authored and JakeChampion committed Jul 18, 2023
1 parent c0b8634 commit ce61789
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,15 @@ export function fetch(input, init) {
}

xhr.onload = function() {
var responseHeaders = xhr.getAllResponseHeaders();
var setCookie = xhr.getResponseHeader('set-cookie');
if (setCookie) {
responseHeaders = responseHeaders.replace(setCookie, setCookie.replace(/\r?\n/g, ', '));
}
var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
headers: parseHeaders(responseHeaders || '')
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
Expand Down

0 comments on commit ce61789

Please sign in to comment.