Skip to content

Commit ebf7a7d

Browse files
committed
Extract
1 parent aa18ff4 commit ebf7a7d

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

packages/browser/src/integrations/breadcrumbs.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -197,27 +197,25 @@ function _addXhrBreadcrumbs(addBreadcrumb: AddBreadcrumb): void {
197197
addInstrumentationHandler((handlerData: { [key: string]: any }): void => {
198198
if (handlerData.endTimestamp) {
199199
// We only capture complete, non-sentry requests
200-
if (handlerData.xhr.__sentry_own_request__) {
201-
return;
202-
}
200+
if (!handlerData.xhr.__sentry_own_request__) {
201+
const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};
203202

204-
const { method, url, status_code, body } = handlerData.xhr.__sentry_xhr__ || {};
205-
206-
addBreadcrumb(
207-
{
208-
category: XHR,
209-
data: {
210-
method,
211-
url,
212-
status_code,
203+
addBreadcrumb(
204+
{
205+
category: XHR,
206+
data: {
207+
method,
208+
url,
209+
status_code,
210+
},
211+
type: 'http',
213212
},
214-
type: 'http',
215-
},
216-
{
217-
xhr: handlerData.xhr,
218-
input: body,
219-
},
220-
);
213+
{
214+
xhr: handlerData.xhr,
215+
input: body,
216+
},
217+
);
218+
}
221219
}
222220
}, XHR);
223221
}

0 commit comments

Comments
 (0)