diff options
Diffstat (limited to 'routers/repo/compare.go')
-rw-r--r-- | routers/repo/compare.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/routers/repo/compare.go b/routers/repo/compare.go index 0b7bdf7649..7046f3ecdb 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -11,6 +11,7 @@ import ( "fmt" "html" "io/ioutil" + "net/http" "path" "path/filepath" "strings" @@ -632,7 +633,7 @@ func CompareDiff(ctx *context.Context) { } else { ctx.Data["HasPullRequest"] = true ctx.Data["PullRequest"] = pr - ctx.HTML(200, tplCompareDiff) + ctx.HTML(http.StatusOK, tplCompareDiff) return } @@ -660,7 +661,7 @@ func CompareDiff(ctx *context.Context) { ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWrite(models.UnitTypePullRequests) - ctx.HTML(200, tplCompare) + ctx.HTML(http.StatusOK, tplCompare) } // ExcerptBlob render blob excerpt contents @@ -679,7 +680,7 @@ func ExcerptBlob(ctx *context.Context) { chunkSize := gitdiff.BlobExcerptChunkSize commit, err := gitRepo.GetCommit(commitID) if err != nil { - ctx.Error(500, "GetCommit") + ctx.Error(http.StatusInternalServerError, "GetCommit") return } section := &gitdiff.DiffSection{ @@ -704,7 +705,7 @@ func ExcerptBlob(ctx *context.Context) { idxRight = lastRight } if err != nil { - ctx.Error(500, "getExcerptLines") + ctx.Error(http.StatusInternalServerError, "getExcerptLines") return } if idxRight > lastRight { @@ -735,7 +736,7 @@ func ExcerptBlob(ctx *context.Context) { ctx.Data["fileName"] = filePath ctx.Data["AfterCommitID"] = commitID ctx.Data["Anchor"] = anchor - ctx.HTML(200, tplBlobExcerpt) + ctx.HTML(http.StatusOK, tplBlobExcerpt) } func getExcerptLines(commit *git.Commit, filePath string, idxLeft int, idxRight int, chunkSize int) ([]*gitdiff.DiffLine, error) { |