Skip to content

Commit

Permalink
fix(node-fetch): Use stringified origin url (#13581)
Browse files Browse the repository at this point in the history
Uses the stringified value of `origin` to call `.endsWith()`.

closes #13574
  • Loading branch information
s1gr1d authored Sep 4, 2024
1 parent ec7d9e3 commit 70f938b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/node/src/integrations/node-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ function getBreadcrumbData(request: FetchRequest): Partial<SanitizedRequestData>
function getAbsoluteUrl(origin: string, path: string = '/'): string {
const url = `${origin}`;

if (origin.endsWith('/') && path.startsWith('/')) {
if (url.endsWith('/') && path.startsWith('/')) {
return `${url}${path.slice(1)}`;
}

if (!origin.endsWith('/') && !path.startsWith('/')) {
if (!url.endsWith('/') && !path.startsWith('/')) {
return `${url}/${path.slice(1)}`;
}

Expand Down

0 comments on commit 70f938b

Please sign in to comment.