Skip to content

Commit

Permalink
Add missing server-side-encryption header for multipart uploads.
Browse files Browse the repository at this point in the history
Former-commit-id: 4b1c8699e3f5f369f5ecde3cdb77be38bb54d398
  • Loading branch information
dkocher committed Nov 25, 2011
1 parent 5a4f4b3 commit ae085de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/ch/cyberduck/core/s3/S3Path.java
Expand Up @@ -773,8 +773,14 @@ public Thread newThread(Runnable r) {

// Initiate multipart upload with metadata
Map<String, Object> metadata = object.getModifiableMetadata();
metadata.put(this.getSession().getClient().getRestHeaderPrefix() + "storage-class",
Preferences.instance().getProperty("s3.storage.class"));
if(StringUtils.isNotBlank(Preferences.instance().getProperty("s3.storage.class"))) {
metadata.put(this.getSession().getClient().getRestHeaderPrefix() + "storage-class",
Preferences.instance().getProperty("s3.storage.class"));
}
if(StringUtils.isNotBlank(Preferences.instance().getProperty("s3.encryption.algorithm"))) {
metadata.put(this.getSession().getClient().getRestHeaderPrefix() + "server-side-encryption",
Preferences.instance().getProperty("s3.encryption.algorithm"));
}

multipart = this.getSession().getClient().multipartStartUpload(
this.getContainerName(), this.getKey(), metadata);
Expand Down

0 comments on commit ae085de

Please sign in to comment.