mirror of https://github.com/apache/jclouds.git
JCLOUDS-1358: Handle 0-byte input with v4 signature
Previously this failed due to use of mark and reset on the InputStream.
This commit is contained in:
parent
d29b79674d
commit
9b59d099d1
|
@ -169,8 +169,7 @@ public class Aws4SignerForAuthorizationHeader extends Aws4SignerBase {
|
|||
|
||||
protected String getPayloadHash(HttpRequest request) {
|
||||
Payload payload = request.getPayload();
|
||||
if (payload == null) {
|
||||
// when payload is null.
|
||||
if (payload == null || "0".equals(getContentLength(request))) {
|
||||
return getEmptyPayloadContentHash();
|
||||
}
|
||||
return calculatePayloadContentHash(payload);
|
||||
|
|
Loading…
Reference in New Issue