if method type of request info is invalid,
CA has to return error code to RI Layer.
Change-Id: Ic34da1c13e63172885a44a114a86f52cbbb34f6f
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/4565
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: MyeongGi Jeong <myeong.jeong@samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
return NULL;
}
+ // check the method type of request info.
+ // Keep this check in sync with CAMethod_t
+ switch (rep->method)
+ {
+ case CA_GET:
+ case CA_POST:
+ case CA_PUT:
+ case CA_DELETE:
+ break;
+ default:
+ OIC_LOG_V(ERROR, TAG, "Method %u is invalid", rep->method);
+ return NULL;
+ }
+
// allocate the request info structure.
CARequestInfo_t *clone = (CARequestInfo_t *) OICMalloc(sizeof(CARequestInfo_t));
if (!clone)