Add server version header
This commit is contained in:
		| @@ -5,7 +5,7 @@ import ( | |||||||
| 	"runtime" | 	"runtime" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| var Version = "v0.1.3" | var Version = "v0.1.4" | ||||||
| var Build string | var Build string | ||||||
|  |  | ||||||
| func FullVersion() string { | func FullVersion() string { | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ import ( | |||||||
| 	"github.com/go-chi/chi/v5" | 	"github.com/go-chi/chi/v5" | ||||||
| 	"github.com/go-chi/chi/v5/middleware" | 	"github.com/go-chi/chi/v5/middleware" | ||||||
| 	"github.com/google/uuid" | 	"github.com/google/uuid" | ||||||
|  | 	"github.uio.no/torjus/apiary" | ||||||
| 	"github.uio.no/torjus/apiary/config" | 	"github.uio.no/torjus/apiary/config" | ||||||
| 	"github.uio.no/torjus/apiary/honeypot" | 	"github.uio.no/torjus/apiary/honeypot" | ||||||
| 	"github.uio.no/torjus/apiary/honeypot/store" | 	"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("Cache-Control", "no-cache") | ||||||
| 	w.Header().Set("Connection", "keep-alive") | 	w.Header().Set("Connection", "keep-alive") | ||||||
| 	w.Header().Set("Access-Control-Allow-Origin", "*") | 	w.Header().Set("Access-Control-Allow-Origin", "*") | ||||||
|  | 	w.Header().Set("Server", apiary.FullVersion()) | ||||||
| 	id, ch := s.addAttemptListener() | 	id, ch := s.addAttemptListener() | ||||||
| 	defer s.closeAttemptListener(id) | 	defer s.closeAttemptListener(id) | ||||||
| 	w.WriteHeader(http.StatusOK) | 	w.WriteHeader(http.StatusOK) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user