Skip to content

Commit 48444ef

Browse files
authored
Merge pull request #1280 from syphar/web-s3-panic
Fixes #1272 - handle S3 not returning last-modified in some cases
2 parents df7bb5c + 4199988 commit 48444ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/storage/s3.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ 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+
// This is a bug from AWS, it should always have a modified date of when it was created if nothing else.
125+
// Workaround it by passing now as the modification time, since the exact time doesn't really matter.
126+
.map_or(Ok(Utc::now()), |lm| parse_timespec(&lm))?;
127+
123128
let compression = res.content_encoding.and_then(|s| s.parse().ok());
124129

125130
Ok(Blob {

0 commit comments

Comments
 (0)