* control: refactor: all handlers are registered via httpRegister()

* move some code to home/control_filtering.go
This commit is contained in:
Simon Zolin
2019-08-21 14:39:37 +03:00
parent e6bd2a101d
commit 452a668a5b
11 changed files with 301 additions and 348 deletions

View File

@@ -57,10 +57,9 @@ type getVersionJSONRequest struct {
// Get the latest available version from the Internet
func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
log.Tracef("%s %v", r.Method, r.URL)
if config.disableUpdate {
log.Tracef("New app version check is disabled by user")
httpError(w, http.StatusInternalServerError, "New app version check is disabled by user")
return
}
@@ -499,7 +498,6 @@ func finishUpdate(u *updateInfo) {
// Perform an update procedure to the latest available version
func handleUpdate(w http.ResponseWriter, r *http.Request) {
log.Tracef("%s %v", r.Method, r.URL)
if len(config.versionCheckJSON) == 0 {
httpError(w, http.StatusBadRequest, "/update request isn't allowed now")