Skip to content

Commit

Permalink
Add next-secure-headers in example projects (#1803)
Browse files Browse the repository at this point in the history
* Add next-secure-headers in example projects

* Update next.config.js paths

* FeatI: set xssProtection: false
  • Loading branch information
theodesp authored Mar 1, 2024
1 parent 0759959 commit 259d926
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 96 deletions.
9 changes: 8 additions & 1 deletion examples/next/app-router/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { withFaust } from '@faustwp/core';
import { createSecureHeaders } from 'next-secure-headers';

/** @type {import('next').NextConfig} */
export default withFaust();
export default withFaust({
async headers() {
return [{ source: '/:path*', headers: createSecureHeaders({
xssProtection: false
}) }];
},
});
3 changes: 2 additions & 1 deletion examples/next/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/node": "^20.6.3",
"@types/react": "^18.2.36",
"@types/react-dom": "^18.2.14",
"typescript": "^5.2.2"
"typescript": "^5.2.2",
"next-secure-headers": "^2.2.0"
}
}
6 changes: 6 additions & 0 deletions examples/next/block-support/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { withFaust, getWpHostname } = require('@faustwp/core');
const { createSecureHeaders } = require('next-secure-headers');

/**
* @type {import('next').NextConfig}
Expand All @@ -15,4 +16,9 @@ module.exports = withFaust({
locales: ['en'],
defaultLocale: 'en',
},
async headers() {
return [{ source: '/:path*', headers: createSecureHeaders({
xssProtection: false
}) }];
},
});
3 changes: 2 additions & 1 deletion examples/next/block-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"@wordpress/scripts": "26.18.0",
"@faustwp/block-editor-utils": "0.2.0",
"@wordpress/base-styles": "^4.41.0",
"@wordpress/block-library": "^8.27.0"
"@wordpress/block-library": "^8.27.0",
"next-secure-headers": "^2.2.0"
},
"engines": {
"node": ">=18",
Expand Down
6 changes: 6 additions & 0 deletions examples/next/faustwp-getting-started/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { withFaust, getWpHostname } = require('@faustwp/core');
const { createSecureHeaders } = require('next-secure-headers');

/**
* @type {import('next').NextConfig}
Expand All @@ -15,4 +16,9 @@ module.exports = withFaust({
locales: ['en'],
defaultLocale: 'en',
},
async headers() {
return [{ source: '/:path*', headers: createSecureHeaders({
xssProtection: false
}) }];
},
});
3 changes: 3 additions & 0 deletions examples/next/faustwp-getting-started/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"react-dom": "^17.0.2",
"sass": "^1.54.9"
},
"devDependencies": {
"next-secure-headers": "^2.2.0"
},
"engines": {
"node": ">=18",
"npm": ">=8"
Expand Down
139 changes: 46 additions & 93 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 259d926

Please sign in to comment.