Skip to content

Commit e1fa704

Browse files
committed
Fixes #1272 - handle S3 not returning last-modified in some cases
1 parent cc1b0c7 commit e1fa704

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/storage/s3.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ impl S3Backend {
119119
content.write_all(data.as_ref())?;
120120
}
121121

122-
let date_updated = parse_timespec(&res.last_modified.unwrap())?;
122+
let date_updated = res
123+
.last_modified
124+
.map_or(Ok(Utc::now()), |lm| parse_timespec(&lm))?;
125+
123126
let compression = res.content_encoding.and_then(|s| s.parse().ok());
124127

125128
Ok(Blob {

0 commit comments

Comments
 (0)