Skip to content

Commit

Permalink
redirect .wiki/* ui link to /wiki
Browse files Browse the repository at this point in the history
fix #18590

Signed-off-by: a1012112796 <[email protected]>
  • Loading branch information
a1012112796 committed Feb 22, 2022
1 parent 704bdf8 commit 4923af3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) {
ctx.Repo.Owner = owner
ctx.Data["Username"] = ctx.Repo.Owner.Name

// redirect link to wiki
if strings.HasSuffix(repoName, ".wiki") {
ctx.Redirect(strings.Replace(ctx.Req.RequestURI, ".wiki", "/wiki", 1))
return
}

// Get repository.
repo, err := repo_model.GetRepositoryByName(owner.ID, repoName)
if err != nil {
Expand Down

0 comments on commit 4923af3

Please sign in to comment.