From b933e9666abdfcd22919dd458c930d944e1e1b7f Mon Sep 17 00:00:00 2001 From: kozec Date: Tue, 6 Jan 2015 22:40:52 +0100 Subject: [PATCH] /rest/upgrade returns HTTP/500 if STNOUPGRADE is defined --- cmd/syncthing/gui.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index cbf2da763..e46cd8039 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -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)