nacx commented on this pull request.


> @@ -779,6 +782,22 @@ private static void addHeader(Multimap<String, String> 
> headers, Headers header,
       return parts.build();
    }
 
+   private static GeneratedHttpRequest 
stripExpectHeaderIfContentZero(GeneratedHttpRequest request) {
+      boolean isBodyEmpty = false;
+      if (request.getPayload() != null) {
+         Long length = 
request.getPayload().getContentMetadata().getContentLength();
+         if (length != null && length == 0) {
+            isBodyEmpty = true;
+         }
+      } else {
+         isBodyEmpty = true;
+      }

This version also makes it explicit to set the body to `empty` if the 
`content-length` is `null`. It is unlikely and I'd say jclouds takes care of 
always setting the content length for payloads with content, but in any case, I 
think it is more correct (unlike the current implementation) to mark the body 
as empty if there content-length is not present

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1120#discussion_r128165640

Reply via email to