From d73e35b0edfc2f3e6a4d1b26b25cfa9327b6d925 Mon Sep 17 00:00:00 2001 From: Ascendise Date: Mon, 28 Oct 2024 21:23:31 +0100 Subject: [PATCH] better naming --- gitea.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitea.go b/gitea.go index 0fc1eff..6065f68 100644 --- a/gitea.go +++ b/gitea.go @@ -102,14 +102,14 @@ func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, _ caddyhtt return caddyhttp.Error(http.StatusNotFound, err) } - SetMimeType(w, r.URL.Path) + SetContentType(w, r.URL.Path) _, err = io.Copy(w, f) return err } // Sets the Content-Type for js, css and html so browsers actually load the stuff -func SetMimeType(w http.ResponseWriter, filePath string) { +func SetContentType(w http.ResponseWriter, filePath string) { if strings.HasSuffix(filePath, ".css") { w.Header().Set("Content-Type", "text/css") } else if strings.HasSuffix(filePath, ".js") {