File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments