Skip to content

Commit 4923af3

Browse files
committed
redirect .wiki/* ui link to /wiki
fix #18590 Signed-off-by: a1012112796 <[email protected]>
1 parent 704bdf8 commit 4923af3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/context/repo.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,12 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
440440
ctx.Repo.Owner = owner
441441
ctx.Data["Username"] = ctx.Repo.Owner.Name
442442

443+
// redirect link to wiki
444+
if strings.HasSuffix(repoName, ".wiki") {
445+
ctx.Redirect(strings.Replace(ctx.Req.RequestURI, ".wiki", "/wiki", 1))
446+
return
447+
}
448+
443449
// Get repository.
444450
repo, err := repo_model.GetRepositoryByName(owner.ID, repoName)
445451
if err != nil {

0 commit comments

Comments
 (0)