Loading go-apps/meep-vis/server/vis.go +8 −4 Original line number Diff line number Diff line Loading @@ -803,10 +803,14 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { } for _, msgTypeString := range v2xSubscription.FilterCriteria.MsgType { msgTypeInt, _ := strconv.Atoi(msgTypeString) if msgTypeInt < 1 && msgTypeInt > 255 { log.Error("MsgType parameter should be between 0-255") errHandlerProblemDetails(w, "MsgType parameter should be between 0-255 in the request body.", http.StatusBadRequest) msgTypeInt, err := strconv.Atoi(msgTypeString) if msgTypeInt < 0 || msgTypeInt > 255 { log.Error("MsgType parameter should be between 1 and 255") errHandlerProblemDetails(w, "MsgType parameter should be between 1 and 255 in the request body.", http.StatusBadRequest) return } else if err != nil { log.Error("MsgType parameter should be between 1 and 255") errHandlerProblemDetails(w, "MsgType parameter should be between 1 and 255 in the request body.", http.StatusBadRequest) return } } Loading Loading
go-apps/meep-vis/server/vis.go +8 −4 Original line number Diff line number Diff line Loading @@ -803,10 +803,14 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { } for _, msgTypeString := range v2xSubscription.FilterCriteria.MsgType { msgTypeInt, _ := strconv.Atoi(msgTypeString) if msgTypeInt < 1 && msgTypeInt > 255 { log.Error("MsgType parameter should be between 0-255") errHandlerProblemDetails(w, "MsgType parameter should be between 0-255 in the request body.", http.StatusBadRequest) msgTypeInt, err := strconv.Atoi(msgTypeString) if msgTypeInt < 0 || msgTypeInt > 255 { log.Error("MsgType parameter should be between 1 and 255") errHandlerProblemDetails(w, "MsgType parameter should be between 1 and 255 in the request body.", http.StatusBadRequest) return } else if err != nil { log.Error("MsgType parameter should be between 1 and 255") errHandlerProblemDetails(w, "MsgType parameter should be between 1 and 255 in the request body.", http.StatusBadRequest) return } } Loading