nacx approved this pull request.
Thanks, @ChaithanyaGK!
Just one minor style comment. The changes LGTM. I'm OK to merge this as soon as
@demobox and @andrewgaul are happy with the change too.
> @@ -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 could be a bit cleaner:
```java
boolean isBodyEmpty = true;
if (request.getPayload() != null) {
Long length = request.getPayload().getContentMetadata().getContentLength();
isBodyEmpty = (length == null || length == 0);
}
```
--
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#pullrequestreview-50815389