mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 07:08:24 +00:00
Merge pull request #1181 from kozec/stnoupgrade-disable-button
Return HTTP/500 from /rest/upgrade if STNOUPGRADE is defined
This commit is contained in:
commit
14014408fb
@ -571,6 +571,10 @@ func restGetEvents(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func restGetUpgrade(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"))
|
rel, err := upgrade.LatestRelease(strings.Contains(Version, "-beta"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 500)
|
http.Error(w, err.Error(), 500)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user