提交 37c9f5e2 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix(@types/express): req.headers[origin] as string

上级 46ab422c
......@@ -33,9 +33,9 @@
"integrity": "sha512-bT9q2eqH/E72AGBQKT50dh6AXzheTqigGZ1GwDiwmx7vfHff0bZOrvUWjvGpNWPNkRmX1vDF6wonG6rlpBHb1A=="
},
"@types/express-serve-static-core": {
"version": "4.0.45",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.0.45.tgz",
"integrity": "sha1-cbsfh9cYdILQ2IUfWylEWOHHhmc="
"version": "4.0.48",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.0.48.tgz",
"integrity": "sha512-+W+fHO/hUI6JX36H8FlgdMHU3Dk4a/Fn08fW5qdd7MjPP/wJlzq9fkCrgaH0gES8vohVeqwefHwPa4ylVKyYIg=="
},
"@types/fluent-ffmpeg": {
"version": "2.1.1",
......
......@@ -106,8 +106,8 @@
"node": ">= 6.9.0"
},
"dependencies": {
"@types/express": "^4.0.36",
"@types/node": "8.0.2",
"@types/express": "4.0.36",
"@types/socket.io": "1.4.29",
"bl": "1.2.1",
"body-parser": "1.17.2",
......
......@@ -90,7 +90,7 @@ export class Server extends EventEmitter {
// cannot use `*` if angular is set `.withCredentials = true`
// see also: https://github.com/whatwg/fetch/issues/251#issuecomment-199946808
// res.header('Access-Control-Allow-Origin', '*')
res.header('Access-Control-Allow-Origin', req.headers['origin'])
res.header('Access-Control-Allow-Origin', req.headers['origin'] as string)
res.header('Access-Control-Allow-Credentials', 'true')
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept')
next()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册