Skip to content

Commit d7a645e

Browse files
committed
make sure we include href
1 parent f08bdf6 commit d7a645e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: packages/core/src/fetch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function getSpanStartOptions(
242242
): Parameters<typeof startInactiveSpan>[0] {
243243
const parsedUrl = parseStringToURLObject(url);
244244
return {
245-
name: parsedUrl ? `${method} ${parsedUrl.pathname}` : method,
245+
name: parsedUrl ? `${method} ${isURLObjectRelative(parsedUrl) ? parsedUrl.pathname : parsedUrl.href}` : method,
246246
attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin),
247247
};
248248
}

Diff for: packages/core/src/utils-hoist/url.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export function parseStringToURLObject(url: string, urlBase?: string | URL | und
6565

6666
const fullUrlObject = new URL(url, base);
6767
if (isRelative) {
68-
// Because we used a fake base URL, we need to return a relative URL object
68+
// Because we used a fake base URL, we need to return a relative URL object.
69+
// We cannot return anything about the origin, host, etc. because it will refer to the fake base URL.
6970
return {
7071
isRelative,
7172
pathname: fullUrlObject.pathname,

0 commit comments

Comments
 (0)