Skip to content

Commit c1ed29a

Browse files
authored
Add secure headers to tutorial example app (#2047)
* Add Faust.js tutorial * Remove unnecessary content locations from Tailwind config * Add wp-dev script to package.json * Add .env.local.example file to tutorial app * Add secure headers to example app * Rename next config file
1 parent 85fb7f6 commit c1ed29a

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const { createSecureHeaders } = require('next-secure-headers');
2+
3+
/**
4+
* @type {import('next').NextConfig}
5+
**/
6+
module.exports = withFaust({
7+
reactStrictMode: true,
8+
sassOptions: {
9+
includePaths: ['node_modules'],
10+
},
11+
images: {
12+
domains: [getWpHostname()],
13+
},
14+
15+
async headers() {
16+
return [
17+
{
18+
source: '/:path*',
19+
headers: createSecureHeaders({
20+
xssProtection: false,
21+
}),
22+
},
23+
];
24+
},
25+
});

examples/next/tutorial/package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/next/tutorial/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@faustwp/core": "^3.1.0",
1818
"graphql": "^16.10.0",
1919
"next": "15.1.6",
20+
"next-secure-headers": "^2.2.0",
2021
"react": "^19.0.0",
2122
"react-dom": "^19.0.0"
2223
},

0 commit comments

Comments
 (0)