fix: include file path in cache ETag

Without the path, two different files in the same repo (same sha, same
anonymization options) shared an ETag. If a browser ever sent the cached
ETag for one file while requesting another, the server would have
returned 304 against the wrong cache entry. Fold the path into the
ETag so each file has its own fingerprint.

Follow-up to b3c1030 (#439).
This commit is contained in:
tdurieux
2026-05-03 21:19:39 +02:00
parent 1f966841ad
commit 88fe8570fd
3 changed files with 35 additions and 17 deletions
+1
View File
@@ -54,6 +54,7 @@ router.get(
}
const etag = fileETag(
req.query.v as string | undefined,
anonymizedPath,
repo.model.options
);
res.header("ETag", etag);