fix bug in how version service handled a bad username authentication
@@ -28,15 +28,15 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) {
log.Debug("versionservice.VersionHandler called")
- w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
- w.Header().Set("Content-Type", "application/json")
- w.WriteHeader(http.StatusOK)
-
_, err := apiserver.Authn(apiserver.VERSION_PERM, w, r)
if err != nil {
return
}
+ w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`)
+ w.Header().Set("Content-Type", "application/json")
+ w.WriteHeader(http.StatusOK)
+
resp := Version()
json.NewEncoder(w).Encode(resp)
