Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Kotahi
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Omo Oaiya
Kotahi
Commits
fa09969a
Commit
fa09969a
authored
4 years ago
by
Jure
Browse files
Options
Downloads
Patches
Plain Diff
fix: disable content security policy
parent
f6d37ad8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/app.js
+8
-7
8 additions, 7 deletions
server/app.js
with
8 additions
and
7 deletions
server/app.js
+
8
−
7
View file @
fa09969a
...
...
@@ -7,7 +7,7 @@ require('dotenv').config({ path: path.join(__dirname, '../.env') })
const
config
=
require
(
'
config
'
)
const
express
=
require
(
'
express
'
)
const
morgan
=
require
(
'
morgan
'
)
const
helmet
=
require
(
'
helmet
'
)
//
const helmet = require('helmet')
const
cookieParser
=
require
(
'
cookie-parser
'
)
const
bodyParser
=
require
(
'
body-parser
'
)
const
passport
=
require
(
'
passport
'
)
...
...
@@ -49,12 +49,13 @@ const configureApp = app => {
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
cookieParser
())
app
.
use
(
helmet
({
contentSecurityPolicy
:
process
.
env
.
NODE_ENV
===
'
production
'
?
undefined
:
false
,
// Disable contentSecurityPolicy for non-prod use, so GraphQl Playground works
}),
)
// TODO: With this requests all try to go to https even when it does not exist
// app.use(
// helmet({
// contentSecurityPolicy:
// process.env.NODE_ENV === 'production' ? undefined : false, // Disable contentSecurityPolicy for non-prod use, so GraphQl Playground works
// }),
// )
app
.
use
(
express
.
static
(
path
.
resolve
(
'
.
'
,
'
_build
'
)))
app
.
use
(
'
/public
'
,
express
.
static
(
path
.
resolve
(
__dirname
,
'
../public
'
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment