Skip to content

Commit 44fc4b5

Browse files
committed
Merge pull request #68 from unclespode/patch-2
Fix: Cannot read property 'headers' of undefined
2 parents a18c126 + 4d5a43d commit 44fc4b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/XMLHttpRequest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ exports.XMLHttpRequest = function() {
205205
this.getResponseHeader = function(header) {
206206
if (typeof header === "string"
207207
&& this.readyState > this.OPENED
208+
&& response
209+
&& response.headers
208210
&& response.headers[header.toLowerCase()]
209211
&& !errorFlag
210212
) {

0 commit comments

Comments
 (0)