aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/context/context.go5
-rw-r--r--routes/repo/issue.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/pkg/context/context.go b/pkg/context/context.go
index 17a5ec96..f106cd40 100644
--- a/pkg/context/context.go
+++ b/pkg/context/context.go
@@ -138,6 +138,11 @@ func (c *Context) JSONSuccess(data interface{}) {
c.JSON(http.StatusOK, data)
}
+// RawRedirect simply calls underlying Redirect method with no escape.
+func (c *Context) RawRedirect(location string, status ...int) {
+ c.Context.Redirect(location, status...)
+}
+
// Redirect responses redirection wtih given location and status.
// It escapes special characters in the location string.
func (c *Context) Redirect(location string, status ...int) {
diff --git a/routes/repo/issue.go b/routes/repo/issue.go
index 850520e3..67071a44 100644
--- a/routes/repo/issue.go
+++ b/routes/repo/issue.go
@@ -901,7 +901,7 @@ func NewComment(c *context.Context, f form.CreateComment) {
typeName = "pulls"
}
if comment != nil {
- c.Redirect(fmt.Sprintf("%s/%s/%d#%s", c.Repo.RepoLink, typeName, issue.Index, comment.HashTag()))
+ c.RawRedirect(fmt.Sprintf("%s/%s/%d#%s", c.Repo.RepoLink, typeName, issue.Index, comment.HashTag()))
} else {
c.Redirect(fmt.Sprintf("%s/%s/%d", c.Repo.RepoLink, typeName, issue.Index))
}