Without request body, there's no point in asking for 100-continue.
With
[JavaUrlHttpCommandExecutor](https://github.com/jclouds/jclouds/blob/f3c3f3b30620ad62dc502cf79bf121ec1773396e/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java),
HttpUrlConnection is throwing an
[IOException](https://github.com/jclouds/jclouds/blob/f3c3f3b30620ad62dc502cf79bf121ec1773396e/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java#L96)
if we expect 100-continue for an PUT/POST request with empty body although it
is returning 201 response code, it is resulting in another network call when we
do
[getHeaderFields](https://github.com/jclouds/jclouds/blob/f3c3f3b30620ad62dc502cf79bf121ec1773396e/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java#L113)
on the connection.
This issue can be easily replicated by invoking putBlob operation with
zero-length blob.
```
ByteSource payload = ByteSource.empty();
Blob blob = blobStore.blobBuilder(blobName)
.payload(payload)
.contentLength(payload.size())
.build();
blobStore.putBlob(containerName, blob);
```
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds/pull/1120
-- Commit Summary --
* Remove Expect header for PUT and POST reqs with content-length=0
-- File Changes --
M apis/s3/src/test/java/org/jclouds/s3/S3ClientMockTest.java (2)
M core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java
(16)
-- Patch Links --
https://github.com/jclouds/jclouds/pull/1120.patch
https://github.com/jclouds/jclouds/pull/1120.diff
--
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