Skip to content

Commit

Permalink
driverdan#190 fix "Cannot read property 'headers' of undefined"
Browse files Browse the repository at this point in the history
  • Loading branch information
d9k committed Jul 29, 2021
1 parent 97966e4 commit f52711f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/XMLHttpRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,12 @@ exports.XMLHttpRequest = function() {
}
var result = "";

for (var i in response.headers) {
var headers = this.response.headers;

for (var i in headers) {
// Cookie headers are excluded
if (i !== "set-cookie" && i !== "set-cookie2") {
result += i + ": " + response.headers[i] + "\r\n";
result += i + ": " + headers[i] + "\r\n";
}
}
return result.substr(0, result.length - 2);
Expand Down

0 comments on commit f52711f

Please sign in to comment.