Title: `url.full` of router spans uses the first path segment as the host when the path starts with `//` · Issue #26157 · getsentry/sentry-javascript · GitHub
Open Graph Title: `url.full` of router spans uses the first path segment as the host when the path starts with `//` · Issue #26157 · getsentry/sentry-javascript
X Title: `url.full` of router spans uses the first path segment as the host when the path starts with `//` · Issue #26157 · getsentry/sentry-javascript
Description: 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/...
Open Graph Description: 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 th...
X Description: 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 th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/26157
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`url.full` of router spans uses the first path segment as the host when the path starts with `//`","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/browser\n\n### SDK Version\n\n11.10.0 (where I saw it); `getAbsoluteUrl` checked on 11.11.0\n\n### Framework Version\n\n@solidjs/start 2.0.6, @solidjs/router 1.0.1, solid-js 1.9.18\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\n```ts\nimport * as Sentry from '@sentry/solidstart';\nimport { solidRouterBrowserTracingIntegration, withSentryRouterRouting } from '@sentry/solidstart/solidrouter';\nimport { Router } from '@solidjs/router';\n\nSentry.init({\n dsn: '__DSN__',\n integrations: [solidRouterBrowserTracingIntegration()],\n tracesSampleRate: 1.0,\n});\n\nconst SentryRouter = withSentryRouterRouting(Router);\n```\n\nThe cause can also be seen without a router:\n\n```ts\nimport { getAbsoluteUrl } from '@sentry/browser';\n\n// @sentry/browser 11.11.0, on a page at https://example.com\ngetAbsoluteUrl('//foo/bar'); // 'https://foo/bar'\n```\n\n### Steps to Reproduce\n\n1. Use the Solid router integration as above.\n2. 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 `/`).\n3. Look at the URL attributes of the pageload span.\n\n### Expected Result\n\n`url.full` is `https://example.com//foo/bar`, the address of the page.\n\n### Actual Result\n\n`url.path` is `//foo/bar`, but `url.full` is `https://foo/bar`: the first path segment became the host.\n\nThe 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`.\n\n### Additional Context\n\nOther 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.\n\nProposed 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.\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/dennev","@type":"Person","name":"dennev"},"datePublished":"2026-11-06T01:05:05Z","url":"https://github.com/getsentry/sentry-javascript/issues/26157"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:abdf9838-2a44-6f63-06d6-118a9b78340a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F96:2A9AF6:FF02BF:16692B7:6B044C84 |
| html-safe-nonce | 35d812d4fd9a948b08b00e16382084ad614a4ef9a760c75e64713fd56021fb0c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Rjk2OjJBOUFGNjpGRjAyQkY6MTY2OTJCNzo2QjA0NEM4NCIsInZpc2l0b3JfaWQiOiI1NDIwMjMyMTc2NTQzNDg1MDYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | df210d118972e32e42e4c350c9a08d3ee201383792d0814f32c42383a658267b |
| hovercard-subject-tag | issue:6234626782 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/26157/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cc62aeff4cd23bb932f5d78d08374c774b8a2fa144be86425b7a7368c1e509f9/getsentry/sentry-javascript/issues/26157 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cc62aeff4cd23bb932f5d78d08374c774b8a2fa144be86425b7a7368c1e509f9/getsentry/sentry-javascript/issues/26157 |
| og:image:alt | 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 th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dennev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 002aa6b95ffa730b0aec436a5c383f536ad677284e60056037fb120afe37b730 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 059f24c781e3a0d7df3f27a97da0e93fab06ae39 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width