Re: [jclouds/jclouds-site] Remove unsupported sections (clojure, Ant, GAE) (#199)
Updated the site. -- 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-site/pull/199#issuecomment-315980868
Re: [jclouds/jclouds-labs] Generate Azure VM password on the fly (#402)
neykov commented on this pull request. > + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.azurecompute.arm.util; + +import com.google.common.io.BaseEncoding; + +import java.util.Random; + +// Seems to be a common theme between providers, perhaps should be provided by core (see other 'Passwords' classes) +public class Passwords { +1 to refactor and add tests. I can give it a try. -- 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-labs/pull/402#discussion_r127899519
Re: [jclouds/jclouds-site] Remove unsupported sections (clojure, Ant, GAE) (#199)
Thanks! :) -- 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-site/pull/199#issuecomment-315987713
[jclouds/jclouds] Handle empty delimiter/prefix in FS store. (#1121)
When delimiter/prefix is an empty string, jclouds filesystem blobstore should treat them as not being set. You can view, comment on, or merge this pull request online at: https://github.com/jclouds/jclouds/pull/1121 -- Commit Summary -- * Handle empty delimiter/prefix in FS store. -- File Changes -- M apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemBlobStoreTest.java (19) M apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java (29) M blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java (6) -- Patch Links -- https://github.com/jclouds/jclouds/pull/1121.patch https://github.com/jclouds/jclouds/pull/1121.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/1121
Re: [jclouds/jclouds] Remove Expect header for PUT and POST reqs with content-length=0 (#1120)
@ChaithanyaGK pushed 1 commit. 467eecc Refactored the code and added a unit test -- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/jclouds/jclouds/pull/1120/files/e12e21821dd3c54bdbae0954216d7d0a1f8514d9..467eeccb71b1e041301b0b4d720c6b22ec37a401
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
ChaithanyaGK commented on this pull request. > @@ -357,6 +357,22 @@ public GeneratedHttpRequest apply(Invocation invocation) > { if (request.getPayload() != null) { contentMetadataCodec.fromHeaders(request.getPayload().getContentMetadata(), headers); } + + boolean isEmptyBody = false; + if ("POST".equals(requestMethod) || "PUT".equals(requestMethod)) { + if (request.getPayload() != null) { +Long length = request.getPayload().getContentMetadata().getContentLength(); +if (length != null && length == 0) { + isEmptyBody = true; +} + } else { +isEmptyBody = true; + } + } + if (isEmptyBody) { + request = request.toBuilder().removeHeader("Expect").build(); + } @nacx Refactored the code to a separate method and added a unit test case to check the functionality. -- 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_r127988381
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
ChaithanyaGK commented on this pull request. > @@ -73,7 +73,7 @@ public void testZeroLengthPutHasContentLengthHeader() > throws IOException, Interr RecordedRequest request = server.takeRequest(); assertEquals(request.getRequestLine(), "PUT /bucket/object HTTP/1.1"); assertEquals(request.getHeaders(CONTENT_LENGTH), ImmutableList.of("0")); - assertEquals(request.getHeaders(EXPECT), ImmutableList.of("100-continue")); + assert request.getHeaders(EXPECT).isEmpty(); Done -- 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_r127988452
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
@andrewgaul Please have a look at the Charles screenshot attached, where two calls are made in case of azure putBlob operation with zero length blob. ![charles1](https://user-images.githubusercontent.com/28896513/28322642-3d1b2142-6bf4-11e7-856e-1d3c00d6d9e2.png) I've added a unit test case to check whether Expect header is stripped in the case of the empty request body. Not sure how to add an integration test to actually check that only one network call is being made. Any leads on this would be very helpful. -- 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#issuecomment-316083949
Re: [jclouds/jclouds] JCLOUDS-533: Amazon S3 server-side encryption (#344)
Has this fix made into any 2.0.x? or is it planned to go into 2.1? -- 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/344#issuecomment-316158047
Re: [jclouds/jclouds] JCLOUDS-533: Amazon S3 server-side encryption (#344)
This patch did not merge since we did not look at the interactions with SSE-C. -- 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/344#issuecomment-316160130
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
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 > 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
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
ChaithanyaGK commented on this pull request. > @@ -779,6 +782,22 @@ private static void addHeader(Multimap > 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 @nacx , will update the PR. -- 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_r128164859
Re: [jclouds/jclouds] Remove Expect header for requests with empty body (#1120)
nacx commented on this pull request. > @@ -779,6 +782,22 @@ private static void addHeader(Multimap > 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
Re: [jclouds/jclouds] Handle empty delimiter/prefix in FS store. (#1121)
Thanks, @timuralp! Conceptually LGTM, but I lack a broad knowledge of the blobstore providers and I'd prefer @andrewgaul to have a look at the change. -- 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/1121#issuecomment-316291066