mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-21 08:46:50 +02:00
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:
@@ -54,6 +54,7 @@ router.get(
|
||||
}
|
||||
const etag = fileETag(
|
||||
req.query.v as string | undefined,
|
||||
anonymizedPath,
|
||||
repo.model.options
|
||||
);
|
||||
res.header("ETag", etag);
|
||||
|
||||
Reference in New Issue
Block a user