Skip to content

Commit 5164935

Browse files
authored
Added X-Frame-Options and CSP (#1690)
1 parent e1db12b commit 5164935

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/webapp/app/entry.server.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ export default function handleRequest(
2525
responseHeaders: Headers,
2626
remixContext: EntryContext
2727
) {
28+
const url = new URL(request.url);
29+
30+
if (url.pathname.startsWith("/login")) {
31+
responseHeaders.set("X-Frame-Options", "SAMEORIGIN");
32+
responseHeaders.set("Content-Security-Policy", "frame-ancestors 'self'");
33+
}
34+
2835
const acceptLanguage = request.headers.get("accept-language");
2936
const locales = parseAcceptLanguage(acceptLanguage, {
3037
validate: Intl.DateTimeFormat.supportedLocalesOf,

0 commit comments

Comments
 (0)