diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-07 19:33:07 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-07 19:33:07 +0200 |
commit | c7a8aa113a914e70e027fea93265c7232b865b5e (patch) | |
tree | d5514cb6e5f49838ff75e814b64652ad244cf0ef /pkg/handler/git | |
parent | 18aa098f50e2a2c7db01dd4d04dde460fd40f5d5 (diff) | |
download | cerrado-c7a8aa113a914e70e027fea93265c7232b865b5e.tar.gz cerrado-c7a8aa113a914e70e027fea93265c7232b865b5e.tar.bz2 cerrado-c7a8aa113a914e70e027fea93265c7232b865b5e.zip |
feat: Add compression
Diffstat (limited to 'pkg/handler/git')
-rw-r--r-- | pkg/handler/git/handler.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go index f3e74c7..28cc99e 100644 --- a/pkg/handler/git/handler.go +++ b/pkg/handler/git/handler.go @@ -6,6 +6,7 @@ import ( "net/http" "path/filepath" + "git.gabrielgio.me/cerrado/pkg/ext" "git.gabrielgio.me/cerrado/pkg/service" "git.gabrielgio.me/cerrado/templates" "github.com/alecthomas/chroma/v2" @@ -50,6 +51,7 @@ func (g *GitHandler) List(w http.ResponseWriter, _ *http.Request) { } func (g *GitHandler) Summary(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") ref, err := g.gitService.GetHead(name) if err != nil { @@ -66,6 +68,7 @@ func (g *GitHandler) Summary(w http.ResponseWriter, r *http.Request) { } func (g *GitHandler) About(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") ref, err := g.gitService.GetHead(name) if err != nil { @@ -81,6 +84,7 @@ func (g *GitHandler) About(w http.ResponseWriter, r *http.Request) { } func (g *GitHandler) Refs(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") tags, err := g.gitService.ListTags(name) @@ -113,6 +117,7 @@ func (g *GitHandler) Refs(w http.ResponseWriter, r *http.Request) { } func (g *GitHandler) Tree(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") ref := r.PathValue("ref") rest := r.PathValue("rest") @@ -137,6 +142,7 @@ func (g *GitHandler) Tree(w http.ResponseWriter, r *http.Request) { } func (g *GitHandler) Blob(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") ref := r.PathValue("ref") rest := r.PathValue("rest") @@ -178,6 +184,7 @@ func (g *GitHandler) Blob(w http.ResponseWriter, r *http.Request) { } func (g *GitHandler) Log(w http.ResponseWriter, r *http.Request) { + ext.SetHTML(w) name := r.PathValue("name") ref := r.PathValue("ref") |