files served from the nix store have time of epoch+1 and static-web-server assumes they're old unchanged files and doesn't send partial updates or refresh the file when it changes. It already has special handling for files with the unix epoch, but the nix store time is epoch+1s; add that special case.
14 lines
445 B
Diff
14 lines
445 B
Diff
diff --git a/src/response.rs b/src/response.rs
|
|
index 25da3d3..92d6203 100644
|
|
--- a/src/response.rs
|
|
+++ b/src/response.rs
|
|
@@ -42,7 +42,7 @@ pub(crate) fn response_body(
|
|
let modified = meta
|
|
.modified()
|
|
.ok()
|
|
- .filter(|&t| t != std::time::UNIX_EPOCH)
|
|
+ .filter(|&t| t > (std::time::UNIX_EPOCH + std::time::Duration::from_secs(1)))
|
|
.map(LastModified::from);
|
|
|
|
match conditionals.check(modified) {
|