Loading go-apps/meep-loc-serv/server/loc-serv.go +17 −2 Original line number Diff line number Diff line Loading @@ -3523,7 +3523,15 @@ func userSubListGET(w http.ResponseWriter, r *http.Request) { queryParams := r.URL.Query() subscriptionType := queryParams.Get("subscription_type") address := queryParams.Get("address") // If subscriptionType is not empty, validate it if subscriptionType != "" { // Validating subscriptionType parameter validSubscriptionTypes := map[string]bool{"event": true, "periodic": true} if _, ok := validSubscriptionTypes[strings.ToLower(subscriptionType)]; !ok { http.Error(w, "Invalid subscription type. Allowed values are 'event' and 'periodic'.", http.StatusBadRequest) return } } var response InlineNotificationSubscriptionList // Create a slice to hold subscriptions Loading Loading @@ -4599,7 +4607,14 @@ func zoneSubListGET(w http.ResponseWriter, r *http.Request) { queryParams := r.URL.Query() subscriptionType := queryParams.Get("subscription_type") zoneId := queryParams.Get("zoneId") if subscriptionType != "" { // Validating subscriptionType parameter validSubscriptionTypes := map[string]bool{"event": true, "status": true} if _, ok := validSubscriptionTypes[strings.ToLower(subscriptionType)]; !ok { http.Error(w, "Invalid subscription type. Allowed values are 'event' and 'status'.", http.StatusBadRequest) return } } var response InlineNotificationSubscriptionList // Create a slice to hold subscriptions Loading Loading
go-apps/meep-loc-serv/server/loc-serv.go +17 −2 Original line number Diff line number Diff line Loading @@ -3523,7 +3523,15 @@ func userSubListGET(w http.ResponseWriter, r *http.Request) { queryParams := r.URL.Query() subscriptionType := queryParams.Get("subscription_type") address := queryParams.Get("address") // If subscriptionType is not empty, validate it if subscriptionType != "" { // Validating subscriptionType parameter validSubscriptionTypes := map[string]bool{"event": true, "periodic": true} if _, ok := validSubscriptionTypes[strings.ToLower(subscriptionType)]; !ok { http.Error(w, "Invalid subscription type. Allowed values are 'event' and 'periodic'.", http.StatusBadRequest) return } } var response InlineNotificationSubscriptionList // Create a slice to hold subscriptions Loading Loading @@ -4599,7 +4607,14 @@ func zoneSubListGET(w http.ResponseWriter, r *http.Request) { queryParams := r.URL.Query() subscriptionType := queryParams.Get("subscription_type") zoneId := queryParams.Get("zoneId") if subscriptionType != "" { // Validating subscriptionType parameter validSubscriptionTypes := map[string]bool{"event": true, "status": true} if _, ok := validSubscriptionTypes[strings.ToLower(subscriptionType)]; !ok { http.Error(w, "Invalid subscription type. Allowed values are 'event' and 'status'.", http.StatusBadRequest) return } } var response InlineNotificationSubscriptionList // Create a slice to hold subscriptions Loading