forked from acouzens/open5gs
[SBI] Check POST format in Subscription (#2152)
POST requests to {apiRoot}/nnrf-nfm/v1/subscriptions/{subscriptionID} return an error
This commit is contained in:
parent
dd2c85b1b0
commit
7c87389b16
|
@ -197,8 +197,19 @@ bool nrf_nnrf_handle_nf_status_subscribe(
|
||||||
ogs_assert(stream);
|
ogs_assert(stream);
|
||||||
ogs_assert(recvmsg);
|
ogs_assert(recvmsg);
|
||||||
|
|
||||||
|
if (recvmsg->h.resource.component[1]) {
|
||||||
|
ogs_error("Invalid POST Format [%s]",
|
||||||
|
recvmsg->h.resource.component[1]);
|
||||||
|
ogs_assert(true ==
|
||||||
|
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
||||||
|
recvmsg, "Invalid POST Format",
|
||||||
|
recvmsg->h.resource.component[1]));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SubscriptionData = recvmsg->SubscriptionData;
|
SubscriptionData = recvmsg->SubscriptionData;
|
||||||
if (!SubscriptionData) {
|
if (!SubscriptionData) {
|
||||||
|
ogs_error("No SubscriptionData");
|
||||||
ogs_assert(true ==
|
ogs_assert(true ==
|
||||||
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
ogs_sbi_server_send_error(stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
||||||
recvmsg, "No SubscriptionData", NULL));
|
recvmsg, "No SubscriptionData", NULL));
|
||||||
|
@ -206,6 +217,7 @@ bool nrf_nnrf_handle_nf_status_subscribe(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SubscriptionData->nf_status_notification_uri) {
|
if (!SubscriptionData->nf_status_notification_uri) {
|
||||||
|
ogs_error("No nfStatusNotificationUri");
|
||||||
ogs_assert(true ==
|
ogs_assert(true ==
|
||||||
ogs_sbi_server_send_error(
|
ogs_sbi_server_send_error(
|
||||||
stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST,
|
||||||
|
|
Loading…
Reference in New Issue