Skip to content

Commit

Permalink
Update CSP (#24)
Browse files Browse the repository at this point in the history
* Change default-src to self
* Add data: to media-src
  • Loading branch information
yshterev authored May 21, 2024
1 parent 9fe05f8 commit 24cafb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {existsSync} = require('fs')
// Documented at https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Content-Security-Policy
const defaultCSP = {
'default-src': [
"'none'"
"'self'"
],
'script-src': [
"'self'",
Expand Down Expand Up @@ -71,6 +71,7 @@ const defaultCSP = {
],
'media-src': [
"'self'",
"data:",
"blob:",
"*.{{base_domain}}",
"*.amazonaws.com",
Expand Down
4 changes: 2 additions & 2 deletions index.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const {merge, trim, reduce} = require('lodash')
const {execSync} = require('child_process')

const defaultCSP = {
'default-src': ["'none'"],
'default-src': ["'self'"],
'child-src': ["blob:"],
'script-src': [
"'self' 'unsafe-inline' 'unsafe-eval'",
Expand Down Expand Up @@ -45,7 +45,7 @@ const defaultCSP = {
"licensing.theoplayer.com",
],
'media-src': [
"'self' blob:",
"'self' data: blob:",
"*.{{base_domain}}",
"*.s3-accelerate.amazonaws.com *.s3.amazonaws.com",
],
Expand Down

0 comments on commit 24cafb3

Please sign in to comment.