diff --git a/__tests__/buildCSPHeaders.js b/__tests__/buildCSPHeaders.js index 12663fc..0ae46b3 100644 --- a/__tests__/buildCSPHeaders.js +++ b/__tests__/buildCSPHeaders.js @@ -19,7 +19,6 @@ const DEFAULT_CSP = { 'manifest-src': '\'self\'', 'media-src': '\'self\'', 'object-src': '\'none\'', - 'prefetch-src': '\'self\'', 'script-src': '\'self\'', 'style-src': '\'self\'', 'worker-src': '\'self\'', diff --git a/docs/api/contentSecurityPolicy.md b/docs/api/contentSecurityPolicy.md index 08bce5c..841417f 100644 --- a/docs/api/contentSecurityPolicy.md +++ b/docs/api/contentSecurityPolicy.md @@ -17,7 +17,6 @@ "manifest-src": "'self'", "media-src": "'self'", "object-src": "'none'", - "prefetch-src": "'self'", "script-src": "'self'", "style-src": "'self'", "worker-src": "'self'", @@ -83,16 +82,6 @@ Note that `'self'` is in quotes. This is a CSP thing and `next-safe` does not ha } ``` -#### Disable the `prefetch-src` directive - -```js -{ - contentSecurityPolicy: { - "prefetch-src": false, - }, -} -``` - #### Disable CSP entirely (NOT recommended) ```js diff --git a/docs/configuration.md b/docs/configuration.md index 930f1ce..2d9fe8a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -18,7 +18,6 @@ nextSafe({ "manifest-src": "'self'", "media-src": "'self'", "object-src": "'none'", - "prefetch-src": "'self'", "script-src": "'self'", "style-src": "'self'", "worker-src": "'self'", diff --git a/lib/buildCSPHeaders.js b/lib/buildCSPHeaders.js index be4aad0..5ba0364 100644 --- a/lib/buildCSPHeaders.js +++ b/lib/buildCSPHeaders.js @@ -70,7 +70,6 @@ module.exports = function buildCSPHeaders(options = {}) { 'manifest-src': getCSPDirective(contentSecurityPolicy['manifest-src'], "'self'", mergeDefaultDirectives), 'media-src': getCSPDirective(contentSecurityPolicy['media-src'], "'self'", mergeDefaultDirectives), 'object-src': getCSPDirective(contentSecurityPolicy['object-src'], "'none'", mergeDefaultDirectives), - 'prefetch-src': getCSPDirective(contentSecurityPolicy['prefetch-src'], "'self'", mergeDefaultDirectives), 'script-src': getCSPDirective(contentSecurityPolicy['script-src'], "'self'", mergeDefaultDirectives), 'style-src': getCSPDirective(contentSecurityPolicy['style-src'], "'self'", mergeDefaultDirectives), 'worker-src': getCSPDirective(contentSecurityPolicy['worker-src'], "'self'", mergeDefaultDirectives), diff --git a/lib/models/CSP.js b/lib/models/CSP.js index 0ed34a3..e92967e 100644 --- a/lib/models/CSP.js +++ b/lib/models/CSP.js @@ -20,7 +20,6 @@ * @property {CSPDirective} ['manifest-src'] * @property {CSPDirective} ['media-src'] * @property {CSPDirective} ['object-src'] - * @property {CSPDirective} ['prefetch-src'] * @property {CSPDirective} ['script-src'] * @property {CSPDirective} ['style-src'] * @property {CSPDirective} ['worker-src']