diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-08-06T15·20+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-08-06T15·20+0200 |
commit | 7de3e00ad905bba85abadd86b83973fdba8d0dfd (patch) | |
tree | 2dd48677ef2c7df0e057a0749fa6bed258b6d64a /src/libstore/s3-binary-cache-store.cc | |
parent | d3761f5f8bce1e4c8dcfdff3fa77c173157c0346 (diff) |
Fix setting Content-Encoding in S3 uploads
Fixes https://github.com/NixOS/nix/issues/2333 and https://github.com/NixOS/nixpkgs/issues/44337.
Diffstat (limited to 'src/libstore/s3-binary-cache-store.cc')
-rw-r--r-- | src/libstore/s3-binary-cache-store.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libstore/s3-binary-cache-store.cc b/src/libstore/s3-binary-cache-store.cc index 660583d31fe0..6d95c1fa8c65 100644 --- a/src/libstore/s3-binary-cache-store.cc +++ b/src/libstore/s3-binary-cache-store.cc @@ -291,10 +291,6 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore transferConfig.s3Client = s3Helper.client; transferConfig.bufferSize = bufferSize; - if (contentEncoding != "") - transferConfig.createMultipartUploadTemplate.SetContentEncoding( - contentEncoding); - transferConfig.uploadProgressCallback = [&](const TransferManager *transferManager, const std::shared_ptr<const TransferHandle> @@ -336,8 +332,10 @@ struct S3BinaryCacheStoreImpl : public S3BinaryCacheStore auto now1 = std::chrono::steady_clock::now(); std::shared_ptr<TransferHandle> transferHandle = - transferManager->UploadFile(stream, bucketName, path, mimeType, - Aws::Map<Aws::String, Aws::String>()); + transferManager->UploadFile( + stream, bucketName, path, mimeType, + Aws::Map<Aws::String, Aws::String>(), + nullptr, contentEncoding); transferHandle->WaitUntilFinished(); |