From 593f0f9b17255372403fe7537cf52e25a4eb93e1 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 27 Mar 2016 21:02:31 +0200 Subject: [PATCH] Include application version into response --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index c2a301a..4a4d3bf 100644 --- a/main.go +++ b/main.go @@ -21,6 +21,8 @@ var ( templates = make(map[string]*pongo2.Template) store storage.Storage cfg *config.Config + + version string ) func main() { @@ -60,6 +62,8 @@ func logHTTPRequest(h http.Handler) http.Handler { start := time.Now().UnixNano() w := NewLogResponseWriter(res) + w.Header().Set("X-Application-Version", version) + h.ServeHTTP(w, r) d := (time.Now().UnixNano() - start) / 1000