summaryrefslogtreecommitdiffstats
path: root/routers/private/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/private/repository.go')
-rw-r--r--routers/private/repository.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/routers/private/repository.go b/routers/private/repository.go
index 0769e1f250..9f451bcf1d 100644
--- a/routers/private/repository.go
+++ b/routers/private/repository.go
@@ -6,7 +6,6 @@ package private
import (
"net/http"
- "net/url"
"code.gitea.io/gitea/models"
@@ -56,18 +55,18 @@ func GetRepository(ctx *macaron.Context) {
func GetActivePullRequest(ctx *macaron.Context) {
baseRepoID := ctx.QueryInt64("baseRepoID")
headRepoID := ctx.QueryInt64("headRepoID")
- baseBranch, err := url.QueryUnescape(ctx.QueryTrim("baseBranch"))
- if err != nil {
+ baseBranch := ctx.QueryTrim("baseBranch")
+ if len(baseBranch) == 0 {
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
- "err": err.Error(),
+ "err": "QueryTrim failed",
})
return
}
- headBranch, err := url.QueryUnescape(ctx.QueryTrim("headBranch"))
- if err != nil {
+ headBranch := ctx.QueryTrim("headBranch")
+ if len(headBranch) == 0 {
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
- "err": err.Error(),
+ "err": "QueryTrim failed",
})
return
}