Skip to content

Commit c47f4c2

Browse files
committed
bug: Store XHR breadcrumb only when readyState === 4
1 parent cea33b8 commit c47f4c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/raven.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,14 +1118,15 @@ Raven.prototype = {
11181118
var xhr = this;
11191119

11201120
function onreadystatechangeHandler() {
1121-
if (xhr.__raven_xhr && (xhr.readyState === 1 || xhr.readyState === 4)) {
1121+
if (xhr.__raven_xhr && xhr.readyState === 4) {
11221122
try {
11231123
// touching statusCode in some platforms throws
11241124
// an exception
11251125
xhr.__raven_xhr.status_code = xhr.status;
11261126
} catch (e) {
11271127
/* do nothing */
11281128
}
1129+
11291130
self.captureBreadcrumb({
11301131
type: 'http',
11311132
category: 'xhr',

0 commit comments

Comments
 (0)