1
0
Fork 0
mirror of https://github.com/Luzifer/mondash.git synced 2024-11-14 02:12:42 +00:00

Include application version into response

This commit is contained in:
Knut Ahlers 2016-03-27 21:02:31 +02:00
parent d0d5587cd9
commit 593f0f9b17

View file

@ -21,6 +21,8 @@ var (
templates = make(map[string]*pongo2.Template) templates = make(map[string]*pongo2.Template)
store storage.Storage store storage.Storage
cfg *config.Config cfg *config.Config
version string
) )
func main() { func main() {
@ -60,6 +62,8 @@ func logHTTPRequest(h http.Handler) http.Handler {
start := time.Now().UnixNano() start := time.Now().UnixNano()
w := NewLogResponseWriter(res) w := NewLogResponseWriter(res)
w.Header().Set("X-Application-Version", version)
h.ServeHTTP(w, r) h.ServeHTTP(w, r)
d := (time.Now().UnixNano() - start) / 1000 d := (time.Now().UnixNano() - start) / 1000