mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: 500 on POST /api/heartbeats
This commit is contained in:
parent
7cca0055fe
commit
4302cfcbd6
@ -79,6 +79,12 @@ func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
|
|||||||
machineName := r.Header.Get("X-Machine-Name")
|
machineName := r.Header.Get("X-Machine-Name")
|
||||||
|
|
||||||
for _, hb := range heartbeats {
|
for _, hb := range heartbeats {
|
||||||
|
if hb == nil {
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
w.Write([]byte("invalid heartbeat object"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
hb.OperatingSystem = opSys
|
hb.OperatingSystem = opSys
|
||||||
hb.Editor = editor
|
hb.Editor = editor
|
||||||
hb.Machine = machineName
|
hb.Machine = machineName
|
||||||
|
Loading…
Reference in New Issue
Block a user