Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormahdi2014-12-24 14:36:51 +0000
committermahdi2014-12-24 14:36:51 +0000
commit5c26a28f4d619cc2497d1c7abd6de9988dd2ff95 (patch)
tree413d8d70cb72e2b09ff53fcfd07f4f9bfbcdc22b
parenta5ec8de8062f36b4007c579745a7c6c6bb39f19f (diff)
downloadorg.eclipse.om2m-5c26a28f4d619cc2497d1c7abd6de9988dd2ff95.tar.gz
org.eclipse.om2m-5c26a28f4d619cc2497d1c7abd6de9988dd2ff95.tar.xz
org.eclipse.om2m-5c26a28f4d619cc2497d1c7abd6de9988dd2ff95.zip
Remove resource representation from coap response body for creation
requests.
-rw-r--r--org.eclipse.om2m.comm.coap/src/main/java/org/eclipse/om2m/comm/coap/CoapServer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.om2m.comm.coap/src/main/java/org/eclipse/om2m/comm/coap/CoapServer.java b/org.eclipse.om2m.comm.coap/src/main/java/org/eclipse/om2m/comm/coap/CoapServer.java
index d8150616..3468b9fb 100644
--- a/org.eclipse.om2m.comm.coap/src/main/java/org/eclipse/om2m/comm/coap/CoapServer.java
+++ b/org.eclipse.om2m.comm.coap/src/main/java/org/eclipse/om2m/comm/coap/CoapServer.java
@@ -239,10 +239,12 @@ class CoapMessageDeliverer implements MessageDeliverer {
Response response= new Response(resCode);
-if(responseConfirm.getRepresentation()!=null){
- //filling in the fields of the Coap response
- response.setPayload(responseConfirm.getRepresentation());
-}
+ if(responseConfirm.getRepresentation()!=null){
+ //filling in the fields of the Coap response
+ if(statusCode != 2.01){
+ response.setPayload(responseConfirm.getRepresentation());
+ }
+ }
response.setMID(mid);
//request.getOptions().setContentFormat(MediaTypeRegistry.TEXT_XML);

Back to the top