mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-14 18:51:34 +03:00
* POST /control/version.json: change response when update is disabled
This commit is contained in:
parent
b9fca8d0a9
commit
d38b58cd85
@ -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.
|
||||
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user