aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlillian <lillian@nowhere>2024-03-29 21:04:05 -0400
committerAnirudh Oppiliappan <x@icyphox.sh>2024-03-30 09:21:26 +0200
commita13ced49e12440e25a4553fd897ca0d009bad11e (patch)
treed5a32d134f271f7d0fef0f27c7eb68eba4d027bd
parentreadme: remove frivolous line from notes (diff)
downloadlegitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.tar.gz
legitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.tar.zst
legitrx-a13ced49e12440e25a4553fd897ca0d009bad11e.zip
re-add accidentally removed code for raw file view
-rw-r--r--routes/routes.go5
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)