Skip to content

Commit 2718fd1

Browse files
committed
use url sanitization helper
1 parent d7a645e commit 2718fd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/fetch.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';
55
import type { FetchBreadcrumbHint, HandlerDataFetch, Span, SpanAttributes, SpanOrigin } from './types-hoist';
66
import { SENTRY_BAGGAGE_KEY_PREFIX } from './utils-hoist/baggage';
77
import { isInstanceOf } from './utils-hoist/is';
8-
import { isURLObjectRelative, parseStringToURLObject } from './utils-hoist/url';
8+
import { getSanitizedUrlStringFromUrlObject, isURLObjectRelative, parseStringToURLObject } from './utils-hoist/url';
99
import { hasSpansEnabled } from './utils/hasSpansEnabled';
1010
import { getActiveSpan } from './utils/spanUtils';
1111
import { getTraceData } from './utils/traceData';
@@ -242,7 +242,7 @@ function getSpanStartOptions(
242242
): Parameters<typeof startInactiveSpan>[0] {
243243
const parsedUrl = parseStringToURLObject(url);
244244
return {
245-
name: parsedUrl ? `${method} ${isURLObjectRelative(parsedUrl) ? parsedUrl.pathname : parsedUrl.href}` : method,
245+
name: parsedUrl ? `${method} ${getSanitizedUrlStringFromUrlObject(parsedUrl)}` : method,
246246
attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin),
247247
};
248248
}

0 commit comments

Comments
 (0)