Skip to content

Commit

Permalink
fix: key and val might be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
zilong-thu authored and surunzi committed Aug 4, 2018
1 parent 1bf8764 commit 71a3f95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Network/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export default class Network extends Tool {
}
let key = arguments[0]
let val = arguments[1]
req._headers[key] = val
if (key && val) {
req._headers[key] = val
}

origSetRequestHeader.apply(this, arguments)
}
Expand Down
2 changes: 1 addition & 1 deletion src/Network/XhrRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class XhrRequest extends Emitter {
size: getSize(xhr, true, this._url),
time: now(),
resHeaders: getHeaders(xhr),
reqHeaders: (xhr.erudaRequest && xhr.erudaRequest._headers) || {}
reqHeaders: (xhr.erudaRequest && xhr.erudaRequest._headers) || null
})
}
handleDone() {
Expand Down

0 comments on commit 71a3f95

Please sign in to comment.