-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace next-secure-headers with Nosecone for security headers (#343)
* Replace next-secure-headers with Nosecone * Disable CSP * Centralize Nosecone config * Set web security headers * Add security headers docs * Update pnpm-lock.yaml * Minor changes * Update headers.mdx --------- Co-authored-by: Hayden Bleasel <[email protected]>
- Loading branch information
1 parent
1ddbc0f
commit 32ee746
Showing
9 changed files
with
150 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { | ||
type NoseconeOptions, | ||
defaults, | ||
withVercelToolbar, | ||
} from '@nosecone/next'; | ||
import { env } from '@repo/env'; | ||
export { createMiddleware as noseconeMiddleware } from '@nosecone/next'; | ||
|
||
// Nosecone security headers configuration | ||
// https://docs.arcjet.com/nosecone/quick-start | ||
const noseconeOptions: NoseconeOptions = { | ||
...defaults, | ||
// Content Security Policy (CSP) is disabled by default because the values | ||
// depend on which Next Forge features are enabled. See | ||
// https://docs.next-forge.com/features/security/headers for guidance on how | ||
// to configure it. | ||
contentSecurityPolicy: false, | ||
}; | ||
|
||
export const noseconeConfig: NoseconeOptions = | ||
env.NODE_ENV === 'development' && env.FLAGS_SECRET | ||
? withVercelToolbar(noseconeOptions) | ||
: noseconeOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.