diff --git a/packages/browser/src/integrations/breadcrumbs.ts b/packages/browser/src/integrations/breadcrumbs.ts index 04b6df82d208..ce032f41180e 100644 --- a/packages/browser/src/integrations/breadcrumbs.ts +++ b/packages/browser/src/integrations/breadcrumbs.ts @@ -249,7 +249,7 @@ export class Breadcrumbs implements Integration { url: string; status_code?: number; } = { - method, + method: isString(method) ? method.toUpperCase() : method, url, }; @@ -397,7 +397,7 @@ export class Breadcrumbs implements Integration { function(this: SentryWrappedXMLHttpRequest, ...args: any[]): void { const url = args[1]; this.__sentry_xhr__ = { - method: args[0], + method: isString(args[0]) ? args[0].toUpperCase() : args[0], url: args[1], }; diff --git a/packages/browser/test/integration/suites/breadcrumbs.js b/packages/browser/test/integration/suites/breadcrumbs.js index 39629efcc81f..03d3e120763c 100644 --- a/packages/browser/test/integration/suites/breadcrumbs.js +++ b/packages/browser/test/integration/suites/breadcrumbs.js @@ -32,7 +32,7 @@ describe("breadcrumbs", function() { function() { return runInSandbox(sandbox, { manual: true }, function() { var xhr = new XMLHttpRequest(); - xhr.open("GET", "/base/subjects/example.json"); + xhr.open("get", "/base/subjects/example.json"); xhr.send(); waitForXHR(xhr, function() { Sentry.captureMessage("test"); @@ -87,7 +87,9 @@ describe("breadcrumbs", function() { it("should record a fetch request", function() { return runInSandbox(sandbox, { manual: true }, function() { - fetch("/base/subjects/example.json") + fetch("/base/subjects/example.json", { + method: "Get", + }) .then( function() { Sentry.captureMessage("test");