Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
nyiyui committed Jan 11, 2025
1 parent b5addc7 commit 055ec62
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion coord/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,17 @@ func (s *Server) postReifyStatus(w http.ResponseWriter, r *http.Request) {
http.Error(w, "failed to read request body", 500)
return
}
zap.S().Infof("postReifyStatus request data: %s", data)
var req PostReifyStatusRequest
err = json.Unmarshal(data, &req)
if err != nil {
http.Error(w, fmt.Sprintf("json decode failed: %s", err), 400)
}
nI, _ := s.spec.GetNetworkIndex(network)
nI, ok := s.spec.GetNetworkIndex(network)
if !ok {
http.Error(w, "invalid request data", 422)
return
}
if !req.Reified.Equal(s.spec.Networks[nI].CensorForDevice(device)) {
zap.S().Infof("given network does not match mine (mine minus given):\n%s", cmp.Diff(req.Reified, s.spec.Networks[nI].CensorForDevice(device)))
data, _ := json.Marshal(req.Reified)
Expand Down

0 comments on commit 055ec62

Please sign in to comment.