Skip to content

Commit e8e4cab

Browse files
authored
Fix X-Frame-Option to prevent clickjacking (e2b-dev#559)
2 parents dde83b7 + b31dd7b commit e8e4cab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/web/next.config.mjs

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ const codeSnippetsDir = path.resolve('./src/code')
4848
const nextConfig = {
4949
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
5050
basePath: '',
51+
headers: async () => [
52+
{
53+
source: '/:path*',
54+
headers: [{
55+
// config to prevent the browser from rendering the page inside a frame or iframe and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
56+
key: 'X-Frame-Options',
57+
value: 'SAMEORIGIN'
58+
}],
59+
}
60+
],
5161
webpack: config => {
5262
const codeFilesHash = getFilesHash(codeSnippetsDir)
5363
config.cache.version = config.cache.version + delimiter + codeFilesHash

0 commit comments

Comments
 (0)