import type { NextConfig } from "next"; const nextConfig: NextConfig = { // 보안 헤더 async headers() { return [ { source: "/(.*)", headers: [ { key: "X-Frame-Options", value: "DENY" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()", }, { key: "Content-Security-Policy", // 디스코드 CDN(이미지)과 자기 자신만 신뢰 value: [ "default-src 'self'", "img-src 'self' data: https://cdn.discordapp.com https://i.scdn.co https://i.ytimg.com https://lh3.googleusercontent.com", "script-src 'self' 'unsafe-inline'" + (process.env.NODE_ENV === "production" ? "" : " 'unsafe-eval'"), "style-src 'self' 'unsafe-inline'", "connect-src 'self' https://discord.com", "font-src 'self' data:", "frame-ancestors 'none'", "base-uri 'self'", "form-action 'self' https://discord.com", ].join("; "), }, ], }, ]; }, }; export default nextConfig;