-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
35 lines (32 loc) · 1.31 KB
/
next.config.ts
File metadata and controls
35 lines (32 loc) · 1.31 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
35
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
// File upload limits are handled in pages/api/order.ts via formidable
// Content Security Policy headers
// Note: We're using PDF.js with isEvalSupported: false to avoid eval
// QRCode library doesn't use eval, so we can safely restrict it
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: [
"default-src 'self'",
"script-src 'self' 'unsafe-inline'", // Removed unsafe-eval - PDF.js configured without eval
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data: blob: https://drive.google.com https://lh3.googleusercontent.com https://*.googleusercontent.com",
"font-src 'self' data:",
"worker-src 'self' blob:",
"connect-src 'self' https://script.google.com https://*.googleapis.com https://drive.google.com",
// Report violations but don't block (for debugging)
// "report-uri /api/csp-report",
].join('; '),
},
],
},
];
},
};
export default nextConfig;