Skip to content

Commit

Permalink
Only write content-type if the object store accepts metadata
Browse files Browse the repository at this point in the history
See: #743
  • Loading branch information
paraseba committed Feb 21, 2025
1 parent 33f41e8 commit 9499746
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions icechunk/src/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ impl S3Storage {
let mut b =
self.get_client().await.put_object().bucket(self.bucket.clone()).key(key);

if let Some(ct) = content_type {
b = b.content_type(ct)
};
if settings.unsafe_use_metadata() {
if let Some(ct) = content_type {
b = b.content_type(ct)
};
}

if settings.unsafe_use_metadata() {
for (k, v) in metadata {
Expand Down Expand Up @@ -312,9 +314,12 @@ impl Storage for S3Storage {
.put_object()
.bucket(self.bucket.clone())
.key(key)
.content_type("application/yaml")
.body(config.into());

if settings.unsafe_use_metadata() {
req = req.content_type("application/yaml")
}

match (
previous_version.etag(),
settings.unsafe_use_conditional_create(),
Expand Down

0 comments on commit 9499746

Please sign in to comment.