Mark static error responses as no-store
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
a04f832761
commit
7957e29cbf
2 files changed
+4
No files matched your search
@@ -185,6 +185,9 @@ async function main() {
|
||||
if ((missingAsset.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") {
|
||||
throw new Error("Smoke test failed: expected nosniff on missing asset response.");
|
||||
}
|
||||
if ((missingAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") {
|
||||
throw new Error("Smoke test failed: expected cache-control=no-store on missing asset.");
|
||||
}
|
||||
const postPage = await fetch(parsedAppUrl, {
|
||||
method: "POST",
|
||||
body: "noop",
|
||||
|
||||
@@ -571,6 +571,7 @@ function startStaticWebServer(distRoot: string, port: number) {
|
||||
response.setHeader("Content-Type", "text/plain; charset=utf-8");
|
||||
response.setHeader("Content-Length", String(body.byteLength));
|
||||
response.setHeader("X-Content-Type-Options", "nosniff");
|
||||
response.setHeader("Cache-Control", "no-store");
|
||||
for (const [key, value] of Object.entries(extraHeaders)) {
|
||||
response.setHeader(key, value);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user