Commit 47fd4150 authored by M. Hamza's avatar M. Hamza
Browse files

fix query params validation logic in meep-vis

parent 7458de3b
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -943,7 +943,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
		return
	}

	if extractSubType.CallbackReference == "" && extractSubType.WebsockNotifConfig.WebsocketUri == "" {
	if extractSubType.CallbackReference == "" && extractSubType.WebsockNotifConfig == nil {
		log.Error("At least one of CallbackReference and WebsockNotifConfig parameters should be present")
		errHandlerProblemDetails(w, "At least one of CallbackReference and WebsockNotifConfig parameters should be present.", http.StatusBadRequest)
		return
@@ -1301,13 +1301,11 @@ func individualSubscriptionPut(w http.ResponseWriter, r *http.Request) {
		return
	}

	if subscriptionCommon.CallbackReference == "" {
		if subscriptionCommon.WebsockNotifConfig.WebsocketUri == "" {
	if subscriptionCommon.CallbackReference == "" && subscriptionCommon.WebsockNotifConfig == nil {
		log.Error("At least one of callbackReference and websockNotifConfig parameters should be present")
		errHandlerProblemDetails(w, "At least one of callbackReference and websockNotifConfig parameters should be present.", http.StatusBadRequest)
		return
	}
	}

	if subscriptionCommon.FilterCriteria == nil {
		log.Error("Mandatory attribute FilterCriteria parameter should be present")