Commit 560ae253 authored by M. Hamza's avatar M. Hamza
Browse files

fix msgType logic in vis.go in meep-vis

parent 0785cb94
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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
			}
		}