Add cors with wildcard origin
This commit is contained in:
parent
49af555da3
commit
a5a1d144aa
3 changed files with 5 additions and 2 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
"command-exists": "^1.2.6",
|
"command-exists": "^1.2.6",
|
||||||
"commander": "^2.9.0",
|
"commander": "^2.9.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cors": "^2.8.4",
|
"cors": "^2.8.5",
|
||||||
"debug": "^3.1.0",
|
"debug": "^3.1.0",
|
||||||
"dotenv": "^8.1.0",
|
"dotenv": "^8.1.0",
|
||||||
"eccrypto": "^1.1.6",
|
"eccrypto": "^1.1.6",
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ const Big = require('big.js')
|
||||||
const size = require('lodash/size')
|
const size = require('lodash/size')
|
||||||
const { range, flatten, evolve } = require('ramda')
|
const { range, flatten, evolve } = require('ramda')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const cors = require('cors')
|
||||||
|
|
||||||
const getListPage = require('../utils/paginate')
|
const getListPage = require('../utils/paginate')
|
||||||
const auth = require('../services/auth/auth')
|
const auth = require('../services/auth/auth')
|
||||||
|
|
@ -210,6 +211,8 @@ module.exports = async (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.use(cors())
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
res.setHeader('x-session-id', SESSION_ID)
|
res.setHeader('x-session-id', SESSION_ID)
|
||||||
next()
|
next()
|
||||||
|
|
|
||||||
|
|
@ -1629,7 +1629,7 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
|
||||||
|
|
||||||
cors@^2.8.4, cors@~2.8.5:
|
cors@^2.8.5, cors@~2.8.5:
|
||||||
version "2.8.5"
|
version "2.8.5"
|
||||||
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
|
resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29"
|
||||||
integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
|
integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue