Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Allow 'self' CSP connect-src by default #13501

Merged
merged 2 commits into from
Mar 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ let generateBraveManifest = () => {
'style-src': '\'self\' \'unsafe-inline\'',
'font-src': '\'self\' data:',
'img-src': '* data: file://*',
'connect-src': 'https://www.youtube.com',
'connect-src': '\'self\' https://www.youtube.com',
'frame-src': '\'self\' https://brave.com'
}

if (process.env.NODE_ENV === 'development') {
// allow access to webpack dev server resources
let devServer = 'localhost:' + process.env.npm_package_config_port
cspDirectives['default-src'] = '\'self\' http://' + devServer
cspDirectives['connect-src'] = cspDirectives['connect-src'] + [
' \'self\'',
cspDirectives['connect-src'] = [
cspDirectives['connect-src'],
'http://' + devServer,
'ws://' + devServer
].join(' ')
Expand Down