mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Fix improper HTMLURL usages in Go code (#22839)
In Go code, HTMLURL should be only used for external systems, like API/webhook/mail/notification, etc. If a URL is used by `Redirect` or rendered in a template, it should be a relative URL (aka `Link()` in Gitea) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -34,7 +34,7 @@ func AddDependency(ctx *context.Context) {
|
||||
}
|
||||
|
||||
// Redirect
|
||||
defer ctx.Redirect(issue.HTMLURL())
|
||||
defer ctx.Redirect(issue.Link())
|
||||
|
||||
// Dependency
|
||||
dep, err := issues_model.GetIssueByID(ctx, depID)
|
||||
@@ -124,5 +124,5 @@ func RemoveDependency(ctx *context.Context) {
|
||||
}
|
||||
|
||||
// Redirect
|
||||
ctx.Redirect(issue.HTMLURL())
|
||||
ctx.Redirect(issue.Link())
|
||||
}
|
||||
|
Reference in New Issue
Block a user