-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
34 lines (32 loc) · 1.14 KB
/
Copy pathnext.config.mjs
File metadata and controls
34 lines (32 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Low-risk hardening headers applied to every response. The Content-Security-
// Policy is set per-request in proxy.ts instead (it needs a fresh nonce
// for the inline bootstrap scripts, which a static header can't carry).
const securityHeaders = [
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "Referrer-Policy", value: "no-referrer" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "Strict-Transport-Security", value: "max-age=31536000" },
{
key: "Permissions-Policy",
value: "camera=(), geolocation=(), microphone=(), payment=(), usb=()",
},
];
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
// Google user-content (avatar) host. Without this, next/image throws
// "hostname not configured" when rendering session.user.image.
remotePatterns: [{ protocol: "https", hostname: "lh3.googleusercontent.com" }],
},
async headers() {
return [
{ source: "/:path*", headers: securityHeaders },
{
source: "/api/:path*",
headers: [{ key: "Cache-Control", value: "private, no-store" }],
},
];
},
};
export default nextConfig;