mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-25 22:45:46 +03:00
Fix version check when req body is empty
This commit is contained in:
parent
ab401cabe2
commit
fdf608904d
1 changed files with 7 additions and 4 deletions
|
@ -45,10 +45,13 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
req := getVersionJSONRequest{}
|
req := getVersionJSONRequest{}
|
||||||
err := json.NewDecoder(r.Body).Decode(&req)
|
var err error
|
||||||
if err != nil {
|
if r.ContentLength != 0 {
|
||||||
httpError(w, http.StatusBadRequest, "JSON parse: %s", err)
|
err = json.NewDecoder(r.Body).Decode(&req)
|
||||||
return
|
if err != nil {
|
||||||
|
httpError(w, http.StatusBadRequest, "JSON parse: %s", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
Loading…
Reference in a new issue