1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 21:55:10 +02:00

actix-files: Fix If-(Un)Modified to not consider sub-seconds (#1887)

This commit is contained in:
Robin Schoonover
2021-01-11 11:18:23 -07:00
committed by GitHub
parent 46a8f28b74
commit a919d2de56
3 changed files with 40 additions and 2 deletions

View File

@@ -331,7 +331,7 @@ impl NamedFile {
let t2: SystemTime = since.clone().into();
match (t1.duration_since(UNIX_EPOCH), t2.duration_since(UNIX_EPOCH)) {
(Ok(t1), Ok(t2)) => t1 > t2,
(Ok(t1), Ok(t2)) => t1.as_secs() > t2.as_secs(),
_ => false,
}
} else {
@@ -350,7 +350,7 @@ impl NamedFile {
let t2: SystemTime = since.clone().into();
match (t1.duration_since(UNIX_EPOCH), t2.duration_since(UNIX_EPOCH)) {
(Ok(t1), Ok(t2)) => t1 <= t2,
(Ok(t1), Ok(t2)) => t1.as_secs() <= t2.as_secs(),
_ => false,
}
} else {