From dfe1fdf6f0c25d746aef2cdb53094435c944e7e4 Mon Sep 17 00:00:00 2001 From: arzumify Date: Thu, 24 Oct 2024 19:39:45 +0100 Subject: [PATCH] Use a custom server header Signed-off-by: arzumify --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 11b8e6c..de09c3a 100644 --- a/main.go +++ b/main.go @@ -65,6 +65,12 @@ var ( slog.Info(r.Method + " " + r.URL.Path) }) } + serverChanger = func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + next.ServeHTTP(w, r) + w.Header().Set("Server", "Fulgens HTTP Server") + }) + } validate *validator.Validate services = make(map[uuid.UUID]Service) lock sync.RWMutex @@ -481,6 +487,7 @@ func main() { // Create the router router := chi.NewRouter() router.Use(logger) + router.Use(serverChanger) // Iterate through the service configurations and create routers for each unique subdomain subdomains := make(map[string]*chi.Mux)