From a13ced49e12440e25a4553fd897ca0d009bad11e Mon Sep 17 00:00:00 2001 From: lillian Date: Fri, 29 Mar 2024 21:04:05 -0400 Subject: re-add accidentally removed code for raw file view --- routes/routes.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'routes') diff --git a/routes/routes.go b/routes/routes.go index 18e3689..e22c7f9 100644 --- a/routes/routes.go +++ b/routes/routes.go @@ -199,6 +199,11 @@ func (d *deps) RepoTree(w http.ResponseWriter, r *http.Request) { } func (d *deps) FileContent(w http.ResponseWriter, r *http.Request) { + var raw bool + if rawParam, err := strconv.ParseBool(r.URL.Query().Get("raw")); err == nil { + raw = rawParam + } + name := r.PathValue("name") if d.isIgnored(name) { d.Write404(w) -- cgit v1.2.3