GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `url.full` of router spans uses the first path segment as the host when the path starts with `//` · Issue #26157 · getsentry/sentry-javascript

url.full of router spans uses the first path segment as the host when the path starts with // #26157

New issue
Copy link
New issue
Copy link
Closed
#26165
Closed
url.full of router spans uses the first path segment as the host when the path starts with //#26157
#26165
Copy link
Assignees
chargome
Labels
BrowserBugSpans

Description

@dennev
dennev
opened on Nov 6, 2026
Issue body actions

Is there an existing issue for this?

  • I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • I have reviewed the documentation https://docs.sentry.io/
  • I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

11.10.0 (where I saw it); getAbsoluteUrl checked on 11.11.0

Framework Version

@solidjs/start 2.0.6, @solidjs/router 1.0.1, solid-js 1.9.18

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from '@sentry/solidstart';
import { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '@sentry/solidstart/solidrouter';
import { Router } from '@solidjs/router';

Sentry.init({
  dsn: '__DSN__',
  integrations: [solidRouterBrowserTracingIntegration()],
  tracesSampleRate: 1.0,
});

const SentryRouter = withSentryRouterRouting(Router);

The cause can also be seen without a router:

import { getAbsoluteUrl } from '@sentry/browser';

// @sentry/browser 11.11.0, on a page at https://example.com
getAbsoluteUrl('//foo/bar'); // 'https://foo/bar'

Steps to Reproduce

  1. Use the Solid router integration as above.
  2. Open a page whose path starts with two slashes, for example https://example.com//foo/bar (a typo, or a link built from a base that ends in /).
  3. Look at the URL attributes of the pageload span.

Expected Result

url.full is https://example.com//foo/bar, the address of the page.

Actual Result

url.path is //foo/bar, but url.full is https://foo/bar: the first path segment became the host.

The Solid router integration sets url.full to getAbsoluteUrl(pathname + search + hash), and getAbsoluteUrl (packages/browser-utils/src/instrumentation/location.ts) resolves it with new URL(urlOrPath, WINDOW.location.origin). A relative reference that starts with // is protocol-relative, so new URL takes foo as the host. I saw the wrong url.full in an app on 11.10.0; this code is the same in 11.11.0 and on develop.

Additional Context

Other integrations also pass a router or window.location pathname to getAbsoluteUrl (@sentry/react-router, for example, passes window.location.pathname directly), so they are probably affected too; I haven't tested them.

Proposed fix: in getAbsoluteUrl, append a value that starts with / to WINDOW.location.origin instead of resolving it as a URL reference, so //foo/bar stays a path on the current origin (#21645 fixed // request paths in core the same way). Full URLs and other relative values keep the current behavior. The trade-off: a value meant as a protocol-relative URL, for example a router.push('//cdn.example.com/x') target in the Next.js app router instrumentation, would then be recorded as a path on the current origin. I have the fix with a unit test ready and can open a PR if this approach works for you.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. dennev
    added
    Bug
    on Nov 6, 2026
  2. linear-code commented on Nov 6, 2026

    @linear-code
    linear-codeBot
    on Nov 6, 2026 – with Linear Code
    More actions

    JS-4080

  3. github-actions
    added
    Browser
    on Nov 6, 2026
  4. linear-code
    added
    Spans
    on Nov 6, 2026
  5. sentry-junior
    added
    Waiting for: Product Owner
    on Nov 6, 2026
  6. getsantry
    added this to GitHub Issues with 👀 3on Nov 6, 2026
  7. chargome
    self-assigned this
    on Nov 6, 2026
  8. chargome
    removed
    Waiting for: Product Owner
    on Nov 6, 2026
  9. chargome commented on Nov 6, 2026

    @chargome
    chargome
    on Nov 6, 2026
    Member
    More actions

    Thanks for raising!

  10. chargome
    closed this as completedin #26165on Nov 6, 2026
  11. kunal649
    added a commit that references this issue on Nov 6, 2026

    fix(browser): Keep the current origin for `//` paths in `url.full` (g…

    This issue will close once commit d2c6f5b is merged into the 'develop' branch.
    d2c6f5b
  12. 43081j
    added a commit that references this issue on Nov 9, 2026

    fix(browser): Keep the current origin for `//` paths in `url.full` (g…

    This issue will close once commit 285aa23 is merged into the 'develop' branch.
    285aa23
  13. github-actions commented on Nov 10, 2026

    @github-actions
    github-actionsBot
    on Nov 10, 2026 – with GitHub Actions
    Contributor
    More actions

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26165, which was included in the 11.12.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @chargome
    chargome

Labels

BrowserBugSpans

Projects

  • GitHub Issues with 👀 3
    Status
    No status
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.