Merge pull request #1181 from kozec/stnoupgrade-disable-button

Return HTTP/500 from /rest/upgrade if STNOUPGRADE is defined
This commit is contained in:
Jakob Borg 2015-01-06 22:54:08 +01:00
commit 14014408fb

View File

@ -571,6 +571,10 @@ func restGetEvents(w http.ResponseWriter, r *http.Request) {
}
func restGetUpgrade(w http.ResponseWriter, r *http.Request) {
if noUpgrade {
http.Error(w, upgrade.ErrUpgradeUnsupported.Error(), 500)
return
}
rel, err := upgrade.LatestRelease(strings.Contains(Version, "-beta"))
if err != nil {
http.Error(w, err.Error(), 500)