Skip to content

Commit ce61789

Browse files
Jake ChampionJakeChampion
Jake Champion
authored andcommittedJul 18, 2023
Resolves #928
1 parent c0b8634 commit ce61789

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎fetch.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,15 @@ export function fetch(input, init) {
537537
}
538538

539539
xhr.onload = function() {
540+
var responseHeaders = xhr.getAllResponseHeaders();
541+
var setCookie = xhr.getResponseHeader('set-cookie');
542+
if (setCookie) {
543+
responseHeaders = responseHeaders.replace(setCookie, setCookie.replace(/\r?\n/g, ', '));
544+
}
540545
var options = {
541546
status: xhr.status,
542547
statusText: xhr.statusText,
543-
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
548+
headers: parseHeaders(responseHeaders || '')
544549
}
545550
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
546551
var body = 'response' in xhr ? xhr.response : xhr.responseText

0 commit comments

Comments
 (0)
Please sign in to comment.