package middleware import ( "net/http" ) // AppInfo adds application name and version headers to the response func AppInfo(name string, version string) func(http.Handler) http.Handler { return func(h http.Handler) http.Handler { fn := func(w http.ResponseWriter, r *http.Request) { w.Header().Set("App-Name", name) w.Header().Set("App-Version", version) h.ServeHTTP(w, r) } return http.HandlerFunc(fn) } }