Add nosniff header for static runtime responses
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
9bc6b6529a
commit
31733ba5c0
2 files changed
+4
No files matched your search
@@ -165,6 +165,9 @@ async function main() {
|
||||
if (page.status !== 200) {
|
||||
throw new Error(`Smoke test failed: expected web status 200, received ${page.status}.`);
|
||||
}
|
||||
if (page.headers.get("x-content-type-options") !== "nosniff") {
|
||||
throw new Error("Smoke test failed: expected x-content-type-options=nosniff.");
|
||||
}
|
||||
|
||||
const wsUrl = parsedAppUrl.searchParams.get("ws");
|
||||
if (!wsUrl) {
|
||||
|
||||
@@ -552,6 +552,7 @@ function startStaticWebServer(distRoot: string, port: number) {
|
||||
|
||||
response.statusCode = 200;
|
||||
response.setHeader("Content-Type", contentTypeFor(targetPath));
|
||||
response.setHeader("X-Content-Type-Options", "nosniff");
|
||||
response.end(content);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user