From baa3990d389a3d8e8f7921a9b81306689d7a6336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 18 Jun 2021 14:51:14 +0200 Subject: [PATCH] Add server version header --- version.go | 2 +- web/server.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/version.go b/version.go index 8a782a7..2c0bed8 100644 --- a/version.go +++ b/version.go @@ -5,7 +5,7 @@ import ( "runtime" ) -var Version = "v0.1.3" +var Version = "v0.1.4" var Build string func FullVersion() string { diff --git a/web/server.go b/web/server.go index de56226..16d701b 100644 --- a/web/server.go +++ b/web/server.go @@ -14,6 +14,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/google/uuid" + "github.uio.no/torjus/apiary" "github.uio.no/torjus/apiary/config" "github.uio.no/torjus/apiary/honeypot" "github.uio.no/torjus/apiary/honeypot/store" @@ -151,6 +152,7 @@ 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)