Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java')
-rw-r--r--org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java b/org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java
index 20b77f29..26d3d7cf 100644
--- a/org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java
+++ b/org.eclipse.om2m.comm.http/src/main/java/org/eclipse/om2m/comm/http/RestHttpClient.java
@@ -26,6 +26,7 @@ import java.util.List;
import java.util.Map;
import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.DeleteMethod;
@@ -113,7 +114,8 @@ public class RestHttpClient implements RestClientService {
}
}
if(statusCode==201){
- if(httpMethod.getResponseHeader("Location").getValue()!=null){
+ Header location = httpMethod.getResponseHeader("Location");
+ if((location != null) && (location.getValue()!=null)){
responseConfirm.setResourceURI(httpMethod.getResponseHeader("Location").getValue());
}
}

Back to the top