On current impl server add CONTENT_FORMAT OPT when response to client, if CONTENT_FORMAT setted on client request.
even payload is not exist on server response.
So, change it as check payload is exist on response before put CONTENT_FORMAT.
Reported-by: byonggon chun
Change-Id: Iced9952adb55304440089c32d658359a67f1dcd5
Signed-off-by: bg.chun <bg.chun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9233
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
OICFree(responseInfo.info.options);
return result;
}
- responseInfo.info.payloadFormat = CA_FORMAT_APPLICATION_CBOR;
+ //Add CONTENT_FORMAT OPT if payload exist
+ if (responseInfo.info.payloadSize > 0)
+ {
+ responseInfo.info.payloadFormat = CA_FORMAT_APPLICATION_CBOR;
+ }
break;
default:
responseInfo.result = CA_NOT_ACCEPTABLE;