Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Secure headers, revision 2 #146

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 30 additions & 23 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ const withMDX = require('@next/mdx')({
},
})

const secureHeaders = [
{
key: 'X-Frame-Options',
value: 'DENY',
},
/* {
key: 'Content-Security-Policy',
value:
"default-src 'self'; img-src 'self' data: https://assets.coingecko.com https://ipfs.io https://raw.githubusercontent.com https://render.githubusercontent.com https://media.giphy.com; media-src 'self' https://media.giphy.com; script-src 'self' 'unsafe-inline' https://plausible.io; font-src 'self'; style-src 'self' 'unsafe-inline'; prefetch-src https://vanilladefi.com *equilibriumco.vercel.app; connect-src 'self' wss://bridge.walletconnect.org https://api.thegraph.com wss://api.thegraph.com https://eth-mainnet.alchemyapi.io wss://eth-mainnet.alchemyapi.io https://plausible.io; frame-ancestors 'none'; base-uri 'none'; form-action 'none'; manifest-src 'self';",
}, */
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
]

module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
i18n: {
Expand All @@ -23,33 +47,16 @@ module.exports = withMDX({
images: {
domains: ['raw.githubusercontent.com', 'ipfs.io', 'assets.coingecko.com'],
},
poweredByHeader: false,
async headers() {
return [
{
source: '/:path*{/}?',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY',
},
/* {
key: 'Content-Security-Policy',
value:
"default-src 'self'; img-src 'self' data: https://assets.coingecko.com https://ipfs.io https://raw.githubusercontent.com https://render.githubusercontent.com https://media.giphy.com; media-src 'self' https://media.giphy.com; script-src 'self' 'unsafe-inline' https://plausible.io; font-src 'self'; style-src 'self' 'unsafe-inline'; prefetch-src https://vanilladefi.com *equilibriumco.vercel.app; connect-src 'self' wss://bridge.walletconnect.org https://api.thegraph.com wss://api.thegraph.com https://eth-mainnet.alchemyapi.io wss://eth-mainnet.alchemyapi.io https://plausible.io; frame-ancestors 'none'; base-uri 'none'; form-action 'none'; manifest-src 'self';",
}, */
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
],
headers: secureHeaders,
},
{
source: '/_next',
headers: secureHeaders,
},
]
},
Expand Down