Enforce CSP on /login as well (#11610)

pull/11611/head
Hariom Balhara 2023-09-29 16:20:15 +05:30 committed by GitHub
parent cf43d9dcfc
commit c22d406d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -40,7 +40,7 @@ const middleware: NextMiddleware = async (req) => {
requestHeaders.set("x-cal-timezone", req.headers.get("x-vercel-ip-timezone") ?? "");
}
if (url.pathname.startsWith("/auth/login")) {
if (url.pathname.startsWith("/auth/login") || url.pathname.startsWith("/login")) {
// Use this header to actually enforce CSP, otherwise it is running in Report Only mode on all pages.
requestHeaders.set("x-csp-enforce", "true");
}
@ -68,6 +68,7 @@ export const config = {
matcher: [
"/:path*/embed",
"/api/trpc/:path*",
"/login",
"/auth/login",
/**
* Paths required by routingForms.handle