mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 16:04:36 +00:00
22 lines
637 B
TypeScript
22 lines
637 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
import { setNoStoreHeaders } from "../../src/server/NoStoreHeaders";
|
|
|
|
describe("NoStoreHeaders", () => {
|
|
test("sets explicit no-store headers", () => {
|
|
const headers = new Map<string, string>();
|
|
const response = {
|
|
setHeader(name: string, value: string) {
|
|
headers.set(name, value);
|
|
},
|
|
} as any;
|
|
|
|
setNoStoreHeaders(response);
|
|
|
|
expect(headers.get("Cache-Control")).toBe(
|
|
"no-store, no-cache, must-revalidate, proxy-revalidate",
|
|
);
|
|
expect(headers.get("Pragma")).toBe("no-cache");
|
|
expect(headers.get("Expires")).toBe("0");
|
|
});
|
|
});
|