Remove util.URLJoin and replace all callers with direct path concatenation#36867
Merged
wxiaoguang merged 2 commits intomainfrom Mar 8, 2026
Merged
Remove util.URLJoin and replace all callers with direct path concatenation#36867wxiaoguang merged 2 commits intomainfrom
util.URLJoin and replace all callers with direct path concatenation#36867wxiaoguang merged 2 commits intomainfrom
Conversation
…atenation Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove util.URLJoin and refactor its usage
Remove Mar 8, 2026
util.URLJoin and replace all callers with direct path concatenation
wxiaoguang
approved these changes
Mar 8, 2026
Member
|
Some replacements assume the base URL ends with — written by Claude |
Member
|
1 minor concern from Claude, otherwise looking good. |
Contributor
|
"test code" only. These tests already have a lot of problems, most of them need to be rewritten. |
silverwind
approved these changes
Mar 8, 2026
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Mar 8, 2026
* main: (26 commits) Clean up `refreshViewedFilesSummary` (go-gitea#36868) Remove `util.URLJoin` and replace all callers with direct path concatenation (go-gitea#36867) Optimize Docker build with dependency layer caching (go-gitea#36864) Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (go-gitea#36861) Fix CodeQL code scanning alerts (go-gitea#36858) Refactor auth middleware (go-gitea#36848) Update Nix flake (go-gitea#36857) Update JS deps (go-gitea#36850) Load `mentionValues` asynchronously (go-gitea#36739) [skip ci] Updated translations via Crowdin Fix dbfs error handling (go-gitea#36844) Fix OAuth2 authorization code expiry and reuse handling (go-gitea#36797) Fix org permission API visibility checks for hidden members and private orgs (go-gitea#36798) Fix non-admins unable to automerge PRs from forks (go-gitea#36833) upgrade to github.com/cloudflare/circl 1.6.3, svgo 4.0.1, markdownlint-cli 0.48.0 (go-gitea#36837) Fix dump release asset bug (go-gitea#36799) build(deps): update material-icon-theme v5.32.0 (go-gitea#36832) Fix bug to check whether user can update pull request branch or rebase branch (go-gitea#36465) Fix forwarded proto handling for public URL detection (go-gitea#36810) Fix artifacts v4 backend upload problems (go-gitea#36805) ... # Conflicts: # pnpm-lock.yaml
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Mar 10, 2026
* giteaofficial/main: Update minimum go version to 1.26.1, golangci-lint to 2.11.2, fix test style (go-gitea#36876) Add render cache for SVG icons (go-gitea#36863) Fix incorrect viewed files counter if reverted change was viewed (go-gitea#36819) [skip ci] Updated translations via Crowdin Clean up `refreshViewedFilesSummary` (go-gitea#36868) Remove `util.URLJoin` and replace all callers with direct path concatenation (go-gitea#36867) Optimize Docker build with dependency layer caching (go-gitea#36864) Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (go-gitea#36861) Fix CodeQL code scanning alerts (go-gitea#36858) Refactor auth middleware (go-gitea#36848) Update Nix flake (go-gitea#36857) Update JS deps (go-gitea#36850) Load `mentionValues` asynchronously (go-gitea#36739) [skip ci] Updated translations via Crowdin Fix dbfs error handling (go-gitea#36844) Fix OAuth2 authorization code expiry and reuse handling (go-gitea#36797) Fix org permission API visibility checks for hidden members and private orgs (go-gitea#36798)
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.
util.URLJoinwas deprecated with unclear semantics (path normalization viaurl.Parse/ResolveReferencethat surprised callers). This removes it entirely and replaces all usages with straightforward"/"string concatenation.Changes
modules/util/url.go: DeleteURLJoinand its unusedpathimportmodules/util/util_test.go: DeleteTestURLJoinservices/convert/git_commit_test.go:headRepo.APIURL() + "/git/commits/" + sha— removeutilimporttests/integration/api_repo_git_tags_test.go:repo.APIURL() + "/git/tags/" + id— removeutilimporttests/integration/api_packages_rpm_test.go:strings.TrimSuffix(setting.AppURL, "/") + groupURL— removeutilimportmodules/markup/html_internal_test.go: UpdateexternalIssueLink/numericIssueLinkhelpers to usestrings.TrimSuffix(baseURL, "/") + "/" + elem; replace remaining direct callsmodules/markup/html_test.go: Replace allutil.URLJoincalls with direct concatenation💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.