diff --git a/routers/repo/search.go b/routers/repo/search.go index 481b64d184a8..e23ebb98806c 100644 --- a/routers/repo/search.go +++ b/routers/repo/search.go @@ -5,7 +5,6 @@ package repo import ( - "path" "strings" "code.gitea.io/gitea/modules/base" @@ -40,7 +39,7 @@ func Search(ctx *context.Context) { ctx.Data["Keyword"] = keyword ctx.Data["Language"] = language ctx.Data["queryType"] = queryType - ctx.Data["SourcePath"] = path.Join(setting.AppSubURL, ctx.Repo.Repository.Owner.Name, ctx.Repo.Repository.Name) + ctx.Data["SourcePath"] = ctx.Repo.Repository.HTMLURL() ctx.Data["SearchResults"] = searchResults ctx.Data["SearchResultLanguages"] = searchResultLanguages ctx.Data["RequireHighlightJS"] = true