Added X-Frame-Options and CSP (#1690)
This commit is contained in:
@@ -25,6 +25,13 @@ export default function handleRequest(
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
) {
|
||||
const url = new URL(request.url);
|
||||
|
||||
if (url.pathname.startsWith("/login")) {
|
||||
responseHeaders.set("X-Frame-Options", "SAMEORIGIN");
|
||||
responseHeaders.set("Content-Security-Policy", "frame-ancestors 'self'");
|
||||
}
|
||||
|
||||
const acceptLanguage = request.headers.get("accept-language");
|
||||
const locales = parseAcceptLanguage(acceptLanguage, {
|
||||
validate: Intl.DateTimeFormat.supportedLocalesOf,
|
||||
|
||||
Reference in New Issue
Block a user