Skip to content

Commit

Permalink
Merge pull request #29 from anvelicon/pr/media-src
Browse files Browse the repository at this point in the history
feat: add media-src to the default CSP
  • Loading branch information
trezy authored Jan 12, 2022
2 parents c5d2c8c + 461b40a commit 8993082
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions __tests__/buildCSPHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const DEFAULT_CSP = {
'frame-src': '\'none\'',
'img-src': '\'self\'',
'manifest-src': '\'self\'',
'media-src': '\'self\'',
'object-src': '\'none\'',
'prefetch-src': '\'self\'',
'script-src': '\'self\'',
Expand Down
1 change: 1 addition & 0 deletions docs/api/contentSecurityPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"frame-src": "'none'",
"img-src": "'self'",
"manifest-src": "'self'",
"media-src": "'self'",
"object-src": "'none'",
"prefetch-src": "'self'",
"script-src": "'self'",
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nextSafe({
"frame-src": "'none'",
"img-src": "'self'",
"manifest-src": "'self'",
"media-src": "'self'",
"object-src": "'none'",
"prefetch-src": "'self'",
"script-src": "'self'",
Expand Down
1 change: 1 addition & 0 deletions lib/buildCSPHeaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = function buildCSPHeaders(options = {}) {
'frame-src': getCSPDirective(contentSecurityPolicy['frame-src'], "'none'"),
'img-src': getCSPDirective(contentSecurityPolicy['img-src'], "'self'"),
'manifest-src': getCSPDirective(contentSecurityPolicy['manifest-src'], "'self'"),
'media-src': getCSPDirective(contentSecurityPolicy['media-src'], "'self'"),
'object-src': getCSPDirective(contentSecurityPolicy['object-src'], "'none'"),
'prefetch-src': getCSPDirective(contentSecurityPolicy['prefetch-src'], "'self'"),
'script-src': getCSPDirective(contentSecurityPolicy['script-src'], "'self'"),
Expand Down
1 change: 1 addition & 0 deletions lib/models/CSP.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @property {CSPDirective} ['frame-src']
* @property {CSPDirective} ['img-src']
* @property {CSPDirective} ['manifest-src']
* @property {CSPDirective} ['media-src']
* @property {CSPDirective} ['object-src']
* @property {CSPDirective} ['prefetch-src']
* @property {CSPDirective} ['script-src']
Expand Down

0 comments on commit 8993082

Please sign in to comment.