Skip to content

Commit 09d51c6

Browse files
authored
fix(webapp): add recommended security headers (#2569)
Sets `Referrer-Policy`, `X-Content-Type-Options` and `Permissions-Policy` headers. Relevant against certain types of attacks.
1 parent 3ceea77 commit 09d51c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/webapp/app/root.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ export const links: LinksFunction = () => {
2020
return [{ rel: "stylesheet", href: tailwindStylesheetUrl }];
2121
};
2222

23+
export const headers = () => ({
24+
"Referrer-Policy": "strict-origin-when-cross-origin",
25+
"X-Content-Type-Options": "nosniff",
26+
"Permissions-Policy":
27+
"geolocation=(), microphone=(), camera=(), accelerometer=(), gyroscope=(), magnetometer=(), payment=(), usb=()",
28+
});
29+
2330
export const meta: MetaFunction = ({ data }) => {
2431
const typedData = data as UseDataFunctionReturn<typeof loader>;
2532
return [

0 commit comments

Comments
 (0)