mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 15:12:10 +08:00
优化 cors 设置
This commit is contained in:
parent
a91bae2e86
commit
f71f586073
14
app.js
14
app.js
@ -7,12 +7,14 @@ let cache = apicache.middleware
|
|||||||
|
|
||||||
// 跨域设置
|
// 跨域设置
|
||||||
// app.all('*', function (req, res, next) {
|
// app.all('*', function (req, res, next) {
|
||||||
// res.header("Access-Control-Allow-Credentials", true)
|
// if (req.path !== '/' && !req.path.includes('.')) {
|
||||||
// res.header("Access-Control-Allow-Origin", "*")
|
// res.header('Access-Control-Allow-Credentials', true)
|
||||||
// res.header("Access-Control-Allow-Headers", "X-Requested-With")
|
// // 这里获取 origin 请求头 而不是用 *
|
||||||
// res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS")
|
// res.header('Access-Control-Allow-Origin', req.headers['origin'] || '*')
|
||||||
// res.header("X-Powered-By", ' 3.2.1')
|
// res.header('Access-Control-Allow-Headers', 'X-Requested-With')
|
||||||
// res.header("Content-Type", "application/json;charset=utf-8")
|
// res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS')
|
||||||
|
// res.header('Content-Type', 'application/json;charset=utf-8')
|
||||||
|
// }
|
||||||
// next()
|
// next()
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
340
package-lock.json
generated
340
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "2.6.3",
|
"version": "2.6.5",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user