Fix version check when req body is empty
This commit is contained in:
parent
ab401cabe2
commit
fdf608904d
|
@ -45,11 +45,14 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
req := getVersionJSONRequest{}
|
req := getVersionJSONRequest{}
|
||||||
err := json.NewDecoder(r.Body).Decode(&req)
|
var err error
|
||||||
|
if r.ContentLength != 0 {
|
||||||
|
err = json.NewDecoder(r.Body).Decode(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, http.StatusBadRequest, "JSON parse: %s", err)
|
httpError(w, http.StatusBadRequest, "JSON parse: %s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
if !req.RecheckNow {
|
if !req.RecheckNow {
|
||||||
|
|
Loading…
Reference in New Issue