diff options
author | lillian <lillian@nowhere> | 2024-03-29 21:04:05 -0400 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2024-03-30 09:21:26 +0200 |
commit | a13ced49e12440e25a4553fd897ca0d009bad11e (patch) | |
tree | d5a32d134f271f7d0fef0f27c7eb68eba4d027bd /routes/routes.go | |
parent | readme: remove frivolous line from notes (diff) | |
download | legitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.tar.gz legitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.tar.zst legitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.zip |
re-add accidentally removed code for raw file view
Diffstat (limited to 'routes/routes.go')
-rw-r--r-- | routes/routes.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |