From 10dc33064002f44098668dbd68163aabed6658d3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 30 Jul 2016 23:39:58 +0800 Subject: #3345 dump content directly to HTTP ResponseWriter --- routers/repo/commit.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'routers') diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 779fd644d3..4eb37e6bdb 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -195,16 +195,15 @@ func Diff(ctx *context.Context) { } func RawDiff(ctx *context.Context) { - diff, err := models.GetRawDiff( + if err := models.GetRawDiff( models.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name), ctx.Params(":sha"), - ctx.Params(":ext"), - ) - if err != nil { - ctx.Handle(404, "GetRawDiff", err) + models.RawDiffType(ctx.Params(":ext")), + ctx.Resp, + ); err != nil { + ctx.Handle(500, "GetRawDiff", err) return } - ctx.HandleText(200, diff) } func CompareDiff(ctx *context.Context) { -- cgit v1.2.3