[NRF] Fix crash due to failing assertion on OPTIONS request

This commit is contained in:
Matthias Bräuer 2023-07-05 15:44:48 +02:00 committed by Sukchan Lee
parent cffd60b356
commit 946a28ab6c
1 changed files with 15 additions and 2 deletions

View File

@ -99,9 +99,22 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e)
}
break;
CASE(OGS_SBI_HTTP_METHOD_OPTIONS)
ogs_assert(
true ==
ogs_sbi_server_send_error(
stream,
OGS_SBI_HTTP_STATUS_NOT_IMPLEMENTED,
&message, "OPTIONS method is not implemented yet",
NULL));
break;
DEFAULT
nf_instance = ogs_sbi_nf_instance_find(
message.h.resource.component[1]);
if (message.h.resource.component[1]) {
nf_instance = ogs_sbi_nf_instance_find(
message.h.resource.component[1]);
}
if (!nf_instance) {
SWITCH(message.h.method)
CASE(OGS_SBI_HTTP_METHOD_PUT)