// Step 1: Generate the response to discovery request
if (virtualUriInRequest == OC_WELL_KNOWN_URI)
{
+ if (request->method == OC_REST_PUT || request->method == OC_REST_POST || request->method == OC_REST_DELETE)
+ {
+ OIC_LOG_V(ERROR, TAG, "Resource : %s not permitted for method: %d", request->resourceUrl, request->method);
+ return OC_STACK_UNAUTHORIZED_REQ;
+ }
+
char *interfaceQuery = NULL;
char *resourceTypeQuery = NULL;
}
else if (virtualUriInRequest == OC_DEVICE_URI)
{
+ if (request->method == OC_REST_PUT || request->method == OC_REST_POST || request->method == OC_REST_DELETE)
+ {
+ OIC_LOG_V(ERROR, TAG, "Resource : %s not permitted for method: %d", request->resourceUrl, request->method);
+ return OC_STACK_UNAUTHORIZED_REQ;
+ }
+
const char* deviceId = OCGetServerInstanceIDString();
if (!deviceId)
{
}
else if (virtualUriInRequest == OC_PLATFORM_URI)
{
+ if (request->method == OC_REST_PUT || request->method == OC_REST_POST || request->method == OC_REST_DELETE)
+ {
+ OIC_LOG_V(ERROR, TAG, "Resource : %s not permitted for method: %d", request->resourceUrl, request->method);
+ return OC_STACK_UNAUTHORIZED_REQ;
+ }
+
payload = (OCPayload*)OCPlatformPayloadCreate(&savedPlatformInfo);
if (!payload)
{
cbNode->method == OC_REST_DELETE)
{
char targetUri[MAX_URI_LENGTH];
- snprintf(targetUri, MAX_URI_LENGTH, "%s?rt=%s",
- OC_RSRVD_RD_URI, OC_RSRVD_RESOURCE_TYPE_RDPUBLISH);
+ snprintf(targetUri, MAX_URI_LENGTH, "%s?rt=%s", OC_RSRVD_RD_URI,
+ OC_RSRVD_RESOURCE_TYPE_RDPUBLISH);
if (strcmp(targetUri, cbNode->requestUri) == 0)
{
type = PAYLOAD_TYPE_RD;