diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-06-04 12:51:47 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2025-06-04 12:51:47 +0200 |
commit | 3739c9e14b0c65a59a520dbfefa459e43af3bf20 (patch) | |
tree | 3731016eb12180f12817ed1094eee8cb0f67b49b /pkg/handler/static | |
parent | 90b2a890096ee9ab3ff84c57542b5220aa9ebe4c (diff) | |
download | cerrado-3739c9e14b0c65a59a520dbfefa459e43af3bf20.tar.gz cerrado-3739c9e14b0c65a59a520dbfefa459e43af3bf20.tar.bz2 cerrado-3739c9e14b0c65a59a520dbfefa459e43af3bf20.zip |
feat: Wrap request
Since request is not a interface I need to create a wraper for it so I
can extend it later.
Diffstat (limited to 'pkg/handler/static')
-rw-r--r-- | pkg/handler/static/handler.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/handler/static/handler.go b/pkg/handler/static/handler.go index 361f690..cdb2ae6 100644 --- a/pkg/handler/static/handler.go +++ b/pkg/handler/static/handler.go @@ -16,7 +16,7 @@ func ServeStaticHandler() (ext.ErrorRequestHandler, error) { return nil, err } - return func(w http.ResponseWriter, r *http.Request) error { + return func(w http.ResponseWriter, r *ext.Request) error { var ( f = r.PathValue("file") e = filepath.Ext(f) @@ -24,7 +24,7 @@ func ServeStaticHandler() (ext.ErrorRequestHandler, error) { ) ext.SetMIME(w, m) w.Header().Add("Cache-Control", "max-age=31536000") - http.ServeFileFS(w, r, staticFs, f) + http.ServeFileFS(w, r.Request, staticFs, f) return nil }, nil } |