Skip to content

Commit 7da9b01

Browse files
committed
update comment to explain why we add a /tree/ path to the repo URLs
1 parent 92cb2a8 commit 7da9b01

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

routers/web/web.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,11 @@ func registerRoutes(m *web.Router) {
15841584
m.Get("/*", context.RepoRefByType(""), repo.Home) // "/*" route is deprecated, and kept for backward compatibility
15851585
}, repo.SetEditorconfigIfExists)
15861586

1587-
// Add a /tree/* path to redirect to the deprecated /src/*
1588-
// path. This emulates both Github & Gitlab's URL structure.
1587+
// Add a /tree/* path to redirect to the /src/* path, which
1588+
// will redirect to the canonical URL for that ref. This is
1589+
// included so that Gitea's repo URL structure matches what
1590+
// other forges provide, allowing clients to construct URLs
1591+
// that work across forges.
15891592
m.Get("/tree/*", repo.HomeRedirect)
15901593

15911594
m.Get("/forks", context.RepoRef(), repo.Forks)

0 commit comments

Comments
 (0)