Skip to content

Commit 964eca9

Browse files
committed
docs: update JSDoc
1 parent 640bdc5 commit 964eca9

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

packages/next-safe-middleware/src/middleware/strictDynamic.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,22 @@ export type StrictDynamicCfg = {
6767
* @see https://web.dev/strict-csp/#step-4:-add-fallbacks-to-support-safari-and-older-browsers
6868
*
6969
* It is also possible, that browsers support 'strict-dynamic', but don't support Hash-based (like Firefox).
70-
* In those cases static routes will use the fallback value for static routes and a Nonce-based strict CSP for dynamic routes.
70+
* In this case, static routes will use the fallback value for script-src and dynamic routes will use a Nonce-based strict CSP.
7171
*
7272
* @see https://github.com/nibtime/next-safe-middleware/issues/5
7373
*/
7474
fallbackScriptSrc?: string;
7575
};
7676

7777
/**
78-
* A middleware to define a strict Content Security Policy (CSP). It will ensure to include hashes of scripts for static routes (`getStaticProps` - Hash-based strict CSP)
79-
* or a nonce for dynamic routes (`getServerSideProps` - Nonce-based strict CSP).
80-
*
8178
* @see https://web.dev/strict-csp/
82-
*
83-
* @param cfg A configuration object for strict CSP
84-
*
79+
*
80+
* @param cfg A configuration object for a strict Content Security Policy (CSP)
81+
*
82+
* @returns
83+
* a middleware that provides a strict CSP. It will ensure to include hashes of scripts for static routes (`getStaticProps` - Hash-based strict CSP)
84+
* or a nonce for dynamic routes (`getServerSideProps` - Nonce-based strict CSP).
85+
*
8586
* Must be used together with custom `next/document` component drop-ins
8687
* that wire it up with page prerendering.
8788
*

0 commit comments

Comments
 (0)