jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhao Jin <notificati...@github.com>
Subject Re: [jclouds] add aws s3 signature v4 (#678)
Date Thu, 05 Mar 2015 06:47:01 GMT
> +        HttpRequest.Builder requestBuilder,
> +        String method,
> +        URI endpoint,
> +        Payload payload
> +    ) {
> +        InputStream payloadStream;
> +        try {
> +            payloadStream = usePayloadForQueryParameters(method, payload) ?
> +                getQueryStringContent(endpoint)
> +                : getPayloadContentWithoutQueryString(payload);
> +        } catch (IOException e) {
> +            throw new HttpException("Unable to open stream before calculate AWS4 signature",
e);
> +        }
> +        String contentSha256 = base16().lowerCase().encode(hash(payloadStream));
> +        try {
> +            payloadStream.reset();

payload stream use calculate content hash.
if can not be repeatable, the payload cannot append to http request body.


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/678/files#r25842533
Mime
View raw message