diff --git a/main.go b/main.go index efee527..e6e8a3f 100644 --- a/main.go +++ b/main.go @@ -220,9 +220,11 @@ func healthHandler(w http.ResponseWriter, r *http.Request) { } func versionHandler(w http.ResponseWriter, r *http.Request) { - v := os.Getenv("SOURCE_COMMIT") - if v == "" { - v = version + v := version + if v == "" || v == "dev" { + if e := os.Getenv("SOURCE_COMMIT"); e != "" { + v = e + } } w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(map[string]string{"version": v})