Repository navigation
Treat server-relative paths as relative in IsAbsoluteUrl on Linux/macOS - #24
Merged
Merged
Conversation
On Linux and macOS, Uri.TryCreate(url, UriKind.Absolute, ...) accepts a
rooted path such as "/page?id=1" as an implicit file URI
(file:///page%3Fid=1), so IsAbsoluteUrl returned true there while
Windows returns false. The existing IsAbsoluteUrl_with_relative_url_is_false
cases ("/mypage", "/mypage/anotherpage") only passed because CI runs on
Windows.
Geta.Optimizely.Extensions' RemoveHost relies on IsAbsoluteUrl and then
returns new Uri(url).PathAndQuery, which escapes the '?' to %3F. On
Linux hosting that breaks every GetFriendlyUrl() result that carries a
query string, e.g. Optimizely On-Page Editing URLs
(",,123?epieditmode=true" becomes ",,123%3Fepieditmode=true", HTTP 500).
"//host/path" and explicit file: URIs keep their current behaviour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Uri parsing is OS-dependent, and the IsAbsoluteUrl bug fixed in the previous commit went unnoticed because CI only ran on windows-latest. The new job is independent of the Windows build and SonarCloud job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gatisb
marked this pull request as ready for review
September 28, 2026 12:29
valdisiljuconoks
approved these changes
Sep 28, 2026
The job failed while setting up, because GitHub no longer serves actions/cache@v1. Move to actions/cache@v4 and actions/checkout@v4, and to actions/setup-java@v4 with JDK 17: the SonarCloud scanner no longer runs on Java 11. Install the .NET 6 runtime that the net6.0 test project needs, which windows-latest no longer ships, and pass the token as sonar.token instead of the deprecated sonar.login. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SONAR_TOKEN no longer authenticates ("Authentication with the server
has failed"), and the Geta_geta-dotnet-extensions project is gone from
the geta SonarCloud organization, so the analysis failed on every run.
The job now just builds and runs the tests on Windows, and the stale
Quality Gate badge is removed from the README.
Also move both jobs to the current Node 24 majors (checkout v7,
setup-dotnet v6); the v4 actions are deprecated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
windows-latest no longer ships the .NET 6 runtime that the net6.0 test project runs on, so a tag build would fail at its Test step. Also move to actions/checkout@v7, the current Node 24 major. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Linux and macOS,
Uri.TryCreate(url, UriKind.Absolute, out _)accepts a rooted path such as/page?id=1as an implicit file URI (file:///page%3Fid=1). SoIsAbsoluteUrl("/page")returnstruethere, while it returnsfalseon Windows.The existing
IsAbsoluteUrl_with_relative_url_is_falsecases (/mypage,/mypage/anotherpage) already expectfalse. They only pass because CI runs onwindows-latest.Downstream impact: Geta.Optimizely.Extensions'
RemoveHost(), which everyGetFriendlyUrl()goes through, doesif (url.IsAbsoluteUrl()) return new Uri(url).PathAndQuery;. On Linux this turns a relative URL with a query string into one with%3Fin its path. For example, the Optimizely On-Page Editing URL/…,,123?epieditmode=truebecomes/…,,123%3Fepieditmode=true, and the CMS returns HTTP 500. We hit this on a CMS 12 site hosted on Linux App Service.RemoveHostdelegates to this method, so a Geta.Net.Extensions patch fixes both Geta.Optimizely.Extensions 2.x (CMS 12) and 3.x (CMS 13) without a new release of that package.Change
IsAbsoluteUrlnow returnsfalsefor server-relative paths: a single leading/thatUriparsed as a file URI. On Windows this changes nothing, becauseTryCreatealready rejects such paths.//host/path(UNC or network-path reference) and explicitfile:URIs behave as before.IsRelativeUrlneeds no change.UriKind.Relativetreats/pageas relative on every OS./,/mypage?query=1and an edit-mode-style URL, plus checks thathttps://…?query=1andfile:///…stay absolute.Test (Linux)job onubuntu-latest, installing .NET 6 viasetup-dotnetfor the net6.0 test project. The existing tests would have caught this bug. Drop the commit if you'd rather not have it.Buildjob first failed in "Set up job", because GitHub no longer servesactions/cache@v1.SONAR_TOKEN(set in 2022) no longer authenticates, and theGeta_geta-dotnet-extensionsproject is gone from thegetaSonarCloud organization.windows-latestno longer ships.actions/checkout@v7,actions/setup-dotnet@v6).release.ymlhad the same gap: its Test step would have failed on a tag build without the .NET 6 runtime. It now installs .NET 6 and usesactions/checkout@v7.Geta.Net.Extensions.<version>.nupkgis created.[3.0.2]entry. I suggest releasing this as v3.0.2.Testing
dotnet teston Windows: 67/67 pass. The new relative-path cases also pass on Windows without the fix, because only Unix is affected.Test (Linux)job covers the Unix behaviour.Notes
SONAR_TOKENrepository secret is now unused, so a repo admin can delete it.sonar.token) that got as far as authentication.IsRelativeUrl_with_invalid_url_is_falsecallsIsAbsoluteUrl()instead ofIsRelativeUrl(). Note that"".IsRelativeUrl()actually returnstrue.🤖 Generated with Claude Code