jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chaithanya Ganta <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-1322: Remove Expect header for requests with empty body (#1120)
Date Thu, 20 Jul 2017 07:02:17 GMT
ChaithanyaGK 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;
+      }

Thanks for the analysis @andrewgaul Will stick to the original code.

-- 
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_r128438490
Mime
View raw message