This commit is contained in:
xiaojunnuo
2026-05-20 16:00:14 +08:00
parent fb5b00d73f
commit 1e7b057946
4 changed files with 12 additions and 5 deletions
@@ -13,7 +13,9 @@ describe("shouldSetDefaultNoCache", () => {
});
it("keeps explicit cache headers from file responses", () => {
assert.equal(shouldSetDefaultNoCache("/api/basic/file/download", "public,max-age=259200"), false);
assert.equal(shouldSetDefaultNoCache("/", "public,max-age=259200"), true);
assert.equal(shouldSetDefaultNoCache("/index.html", "public,max-age=259200"), true);
assert.equal(shouldSetDefaultNoCache("/api/basic/file/download", "public,max-age=259200"), false);
});
it("ignores non-html and non-api paths", () => {