Skip to content

Fixes #1272 - handle S3 not returning last-modified in some cases #1280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ impl S3Backend {
content.write_all(data.as_ref())?;
}

let date_updated = parse_timespec(&res.last_modified.unwrap())?;
let date_updated = res
.last_modified
// This is a bug from AWS, it should always have a modified date of when it was created if nothing else.
// Workaround it by passing now as the modification time, since the exact time doesn't really matter.
.map_or(Ok(Utc::now()), |lm| parse_timespec(&lm))?;

let compression = res.content_encoding.and_then(|s| s.parse().ok());

Ok(Blob {
Expand Down