chronograf/server/version.go

14 lines
258 B
Go
Raw Normal View History

2017-01-13 23:10:50 +00:00
package server
import (
"net/http"
)
func Version(version string, h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("X-Chronograf-Version", version)
h.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
}