Commit bcc3850a authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in subscription UuUni

parent cb3345b4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1344,6 +1344,12 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
		return
	}

	if subscriptionCommon.SubscriptionType != "ProvChgUuUniSubscription" && subscriptionCommon.SubscriptionType != "ProvChgUuMbmsSubscription" && subscriptionCommon.SubscriptionType != "ProvChgPc5Subscription" && subscriptionCommon.SubscriptionType != "V2xMsgSubscription" && subscriptionCommon.SubscriptionType != "PredQosSubscription" {
		log.Error("Invalid SubscriptionType")
		errHandlerProblemDetails(w, "Invalid SubscriptionType", http.StatusBadRequest)
		return
	}

	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)
@@ -1375,6 +1381,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
			return
		}
		w.Header().Set("Location", provChgUuUniSubscription.Links.Self.Href)

	case PROV_CHG_UU_MBMS:
		var provChgUuMbmsSubscription ProvChgUuMbmsSubscription
@@ -1384,6 +1391,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
			return
		}
		w.Header().Set("Location", provChgUuMbmsSubscription.Links.Self.Href)

	case PROV_CHG_PC5:
		var provChgPc5Subscription ProvChgPc5Subscription
@@ -1393,6 +1401,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
			return
		}
		w.Header().Set("Location", provChgPc5Subscription.Links.Self.Href)

	case V2X_MSG:
		var v2xSubscription V2xMsgSubscription
@@ -1402,6 +1411,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
			errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
			return
		}
		w.Header().Set("Location", v2xSubscription.Links.Self.Href)

	case PRED_QOS: // FIXME FSCOM There is no PredQosNotification defined by the standard ETSI GS MEC 030 V3.1.1 (2023-03)
		errHandlerProblemDetails(w, "There is no PredQosNotification defined by the standard ETSI GS MEC 030 V3.1.1 (2023-03)", http.StatusBadRequest)
@@ -1413,6 +1423,7 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) {
		// 	errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError)
		// 	return
		// }
		//w.Header().Set("Location", predQosSubscription.Links.Self.Href)

	default:
		log.Error("Unsupported subscriptionType")