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:
parent
d0d5587cd9
commit
593f0f9b17
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue