diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-02-11 14:34:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-11 14:34:11 +0800 |
commit | e9288c24773157411edec17c9bbcc8c1567e91ee (patch) | |
tree | b34c730a13ab9a56d14b0fcccf1e136ca0233b68 /routers/web/repo/issue_dependency.go | |
parent | 1cb8d14bf71e0b8637c9eaa10808b4fd05139f45 (diff) | |
download | gitea-e9288c24773157411edec17c9bbcc8c1567e91ee.tar.gz gitea-e9288c24773157411edec17c9bbcc8c1567e91ee.zip |
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>
Diffstat (limited to 'routers/web/repo/issue_dependency.go')
-rw-r--r-- | routers/web/repo/issue_dependency.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/issue_dependency.go b/routers/web/repo/issue_dependency.go index 41c127be91..365d9609d6 100644 --- a/routers/web/repo/issue_dependency.go +++ b/routers/web/repo/issue_dependency.go @@ -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()) } |