diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2024-02-25 23:15:21 +0200 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2024-02-25 23:15:21 +0200 |
commit | a87f88a57c68627a1f63f1551fcef2c1f1ec7036 (patch) | |
tree | 232d2d89b717c6368008e9ab3f7dec569b62fb18 /routes/template.go | |
parent | deps: bump go-git (diff) | |
download | legitrx-a87f88a57c68627a1f63f1551fcef2c1f1ec7036.tar.gz legitrx-a87f88a57c68627a1f63f1551fcef2c1f1ec7036.tar.zst legitrx-a87f88a57c68627a1f63f1551fcef2c1f1ec7036.zip |
routes: add raw file view
Diffstat (limited to '')
-rw-r--r-- | routes/template.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routes/template.go b/routes/template.go index 20d678b..0b03015 100644 --- a/routes/template.go +++ b/routes/template.go @@ -95,3 +95,10 @@ func (d *deps) showFile(content string, data map[string]any, w http.ResponseWrit return } } + +func (d *deps) showRaw(content string, w http.ResponseWriter) { + w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "text/plain") + w.Write([]byte(content)) + return +} |