From 0cce8aecc646e4a6e90fbdc977f1d7b752a50e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 18 Jun 2021 14:56:00 +0200 Subject: [PATCH] Set server version in correct place --- version.go | 2 +- web/server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/version.go b/version.go index 2c0bed8..3c113e2 100644 --- a/version.go +++ b/version.go @@ -5,7 +5,7 @@ import ( "runtime" ) -var Version = "v0.1.4" +var Version = "v0.1.5" var Build string func FullVersion() string { diff --git a/web/server.go b/web/server.go index 16d701b..a1b1a1c 100644 --- a/web/server.go +++ b/web/server.go @@ -84,6 +84,7 @@ func NewServer(cfg config.FrontendConfig, hs *honeypot.HoneypotServer, store sto r.Use(middleware.RealIP) r.Use(middleware.RequestID) r.Use(s.LoggingMiddleware) + r.Use(middleware.SetHeader("Server", apiary.FullVersion())) r.Route("/", func(r chi.Router) { r.Get("/*", s.IndexHandler("web/vue-frontend/dist")) @@ -152,7 +153,6 @@ func (s *Server) HandlerAttemptStream(w http.ResponseWriter, r *http.Request) { w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") w.Header().Set("Access-Control-Allow-Origin", "*") - w.Header().Set("Server", apiary.FullVersion()) id, ch := s.addAttemptListener() defer s.closeAttemptListener(id) w.WriteHeader(http.StatusOK)