Skip to content

Commit 055ec62

Browse files
committed
oops
1 parent b5addc7 commit 055ec62

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

coord/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,17 @@ func (s *Server) postReifyStatus(w http.ResponseWriter, r *http.Request) {
263263
http.Error(w, "failed to read request body", 500)
264264
return
265265
}
266+
zap.S().Infof("postReifyStatus request data: %s", data)
266267
var req PostReifyStatusRequest
267268
err = json.Unmarshal(data, &req)
268269
if err != nil {
269270
http.Error(w, fmt.Sprintf("json decode failed: %s", err), 400)
270271
}
271-
nI, _ := s.spec.GetNetworkIndex(network)
272+
nI, ok := s.spec.GetNetworkIndex(network)
273+
if !ok {
274+
http.Error(w, "invalid request data", 422)
275+
return
276+
}
272277
if !req.Reified.Equal(s.spec.Networks[nI].CensorForDevice(device)) {
273278
zap.S().Infof("given network does not match mine (mine minus given):\n%s", cmp.Diff(req.Reified, s.spec.Networks[nI].CensorForDevice(device)))
274279
data, _ := json.Marshal(req.Reified)

0 commit comments

Comments
 (0)