summaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/repo/view.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index 2c703fc1af..c71562f271 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -353,6 +353,10 @@ func renderDirectory(ctx *context.Context, treeLink string) {
}
} else {
ctx.Data["IsRenderedHTML"] = true
+ buf, err = ioutil.ReadAll(rd)
+ if err != nil {
+ log.Error("ReadAll failed: %v", err)
+ }
ctx.Data["FileContent"] = strings.ReplaceAll(
gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`,
)