-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
72 lines (67 loc) · 2.13 KB
/
next.config.js
File metadata and controls
72 lines (67 loc) · 2.13 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const webpack = require('webpack');
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
hostname: 'placekitten.com',
},
{
hostname: 'agenda-ahora-production.s3.us-east-1.amazonaws.com',
},
{
hostname: 'agenda-ahora-production.s3.amazonaws.com',
},
],
},
typescript: {
ignoreBuildErrors: true,
},
webpack: (config, { isServer, nextRuntime }) => {
if (isServer && nextRuntime === 'nodejs')
config.plugins.push(
new webpack.IgnorePlugin({ resourceRegExp: /^aws-crt$/ }),
);
return config;
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim(),
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
],
},
];
},
};
const dns = 'dev.api.agendaahora.com dev.front.agendaahora.com';
const ContentSecurityPolicy = `
img-src 'self' blob: data: ${dns} www.paypalobjects.com;
script-src 'self' blob: 'unsafe-inline' 'unsafe-eval';
script-src-elem 'self' 'unsafe-inline' www.paypal.com;
style-src 'self' 'unsafe-inline';
font-src 'self' data:;
object-src 'self' data:;
frame-src 'self' www.sandbox.paypal.com;
frame-ancestors 'self' www.sandbox.paypal.com;
form-action 'self';
connect-src 'self' ${dns} currency-converter5.p.rapidapi.com www.sandbox.paypal.com cognito-idp.us-east-1.amazonaws.com cognito-identity.us-east-1.amazonaws.com agenda-ahora-production.s3.us-east-1.amazonaws.com localhost:*;
default-src 'self';
`;
module.exports = nextConfig;