mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-25 00:51:22 +08:00
fix: 修复 cookie 解析器并也尝试从请求头读 cookie
This commit is contained in:
+6
-2
@@ -1,11 +1,15 @@
|
||||
const { hasCookie } = require('./index')
|
||||
const { getCookieHeader, hasCookie } = require('./index')
|
||||
|
||||
const createOption = (query, crypto = '', checkToken = false) => {
|
||||
const headerCookie = getCookieHeader(query.headers)
|
||||
|
||||
return {
|
||||
crypto: query.crypto || crypto || '',
|
||||
cookie: hasCookie(query.cookie)
|
||||
? query.cookie
|
||||
: process.env.NETEASE_COOKIE,
|
||||
: hasCookie(headerCookie)
|
||||
? headerCookie
|
||||
: process.env.NETEASE_COOKIE,
|
||||
ua: query.ua || '',
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
|
||||
Reference in New Issue
Block a user