提交 f71f5860 编写于 作者: B binaryify

优化 cors 设置

上级 a91bae2e
......@@ -7,12 +7,14 @@ let cache = apicache.middleware
// 跨域设置
// app.all('*', function (req, res, next) {
// res.header("Access-Control-Allow-Credentials", true)
// res.header("Access-Control-Allow-Origin", "*")
// res.header("Access-Control-Allow-Headers", "X-Requested-With")
// res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS")
// res.header("X-Powered-By", ' 3.2.1')
// res.header("Content-Type", "application/json;charset=utf-8")
// if (req.path !== '/' && !req.path.includes('.')) {
// res.header('Access-Control-Allow-Credentials', true)
// // 这里获取 origin 请求头 而不是用 *
// res.header('Access-Control-Allow-Origin', req.headers['origin'] || '*')
// res.header('Access-Control-Allow-Headers', 'X-Requested-With')
// res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS')
// res.header('Content-Type', 'application/json;charset=utf-8')
// }
// next()
// })
......
此差异已折叠。
{
"name": "NeteaseCloudMusicApi",
"version": "2.6.3",
"version": "2.6.5",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册