Files
nixpkgs/pkgs/by-name/st/static-web-server/include-unix-time-plus-one.diff
BenZuckier 9103ac269e static-web-server: handle files from nix store epoch+1
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.
2026-03-22 22:40:22 -04:00

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) {