Skip to content

Commit

Permalink
* POST /control/version.json: change response when update is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
szolin committed Jul 14, 2020
1 parent b9fca8d commit d38b58c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AGHTechDoc.md
Expand Up @@ -344,10 +344,14 @@ Response:

If `can_autoupdate` is true, then the server can automatically upgrade to a new version.

Response with empty body:
Response when auto-update is disabled by command-line aragument:

200 OK

{
"disabled":true
}

It means that update check is disabled by user. UI should do nothing.


Expand Down
4 changes: 4 additions & 0 deletions home/control_update.go
Expand Up @@ -41,6 +41,10 @@ type getVersionJSONRequest struct {
// Get the latest available version from the Internet
func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
if Context.disableUpdate {
resp := make(map[string]interface{})
resp["disabled"] = true
d, _ := json.Marshal(resp)
_, _ = w.Write(d)
return
}

Expand Down

0 comments on commit d38b58c

Please sign in to comment.