Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yPhil
Pétrolette
Commits
0ceede13
Commit
0ceede13
authored
Mar 12, 2022
by
yPhil
Browse files
contentSecurityPolicy
parent
b2af123b
Pipeline
#495153
passed with stage
in 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
petrolette.js
View file @
0ceede13
...
...
@@ -27,17 +27,17 @@ app.use(helmet({contentSecurityPolicy: false, crossOriginEmbedderPolicy: false})
// app.use(helmet({contentSecurityPolicy: false, crossOriginEmbedderPolicy: false}));
//
app.use(
//
helmet.contentSecurityPolicy({
//
directives: {
//
defaultSrc: ["'self'", "https://www.googleapis.com", "https://api.dropboxapi.com", "https://content.dropboxapi.com", "https:"],
//
imgSrc: ["'self'", "'unsafe-inline'", "https:", "data:"],
//
styleSrc: ["'self'", "'unsafe-inline'"],
//
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'"],
//
scriptSrcAttr: null,
//
},
//
})
//
);
app
.
use
(
helmet
.
contentSecurityPolicy
({
directives
:
{
defaultSrc
:
[
"
'self'
"
,
"
https://www.googleapis.com
"
,
"
https://api.dropboxapi.com
"
,
"
https://content.dropboxapi.com
"
,
"
https:
"
],
imgSrc
:
[
"
'self'
"
,
"
'unsafe-inline'
"
,
"
https:
"
,
"
data:
"
],
styleSrc
:
[
"
'self'
"
,
"
'unsafe-inline'
"
],
scriptSrc
:
[
"
'self'
"
,
"
'unsafe-inline'
"
,
"
'unsafe-eval'
"
],
scriptSrcAttr
:
null
,
},
})
);
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment