From 3739c9e14b0c65a59a520dbfefa459e43af3bf20 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 4 Jun 2025 12:51:47 +0200 Subject: feat: Wrap request Since request is not a interface I need to create a wraper for it so I can extend it later. --- pkg/handler/static/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/handler/static') 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 } -- cgit v1.2.3