mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
修复代码错误
This commit is contained in:
parent
4f7266e4a5
commit
3b15fe9024
17
app.js
17
app.js
@ -38,15 +38,14 @@ app.use((req, res, next) => {
|
||||
|
||||
// cookie parser
|
||||
app.use((req, res, next) => {
|
||||
req.cookies = {}(req.headers.cookie || '')
|
||||
.split(/\s*;\s*/)
|
||||
.forEach((pair) => {
|
||||
let crack = pair.indexOf('=')
|
||||
if (crack < 1 || crack == pair.length - 1) return
|
||||
req.cookies[
|
||||
decodeURIComponent(pair.slice(0, crack)).trim()
|
||||
] = decodeURIComponent(pair.slice(crack + 1)).trim()
|
||||
})
|
||||
req.cookies = {}
|
||||
;(req.headers.cookie || '').split(/\s*;\s*/).forEach((pair) => {
|
||||
let crack = pair.indexOf('=')
|
||||
if (crack < 1 || crack == pair.length - 1) return
|
||||
req.cookies[
|
||||
decodeURIComponent(pair.slice(0, crack)).trim()
|
||||
] = decodeURIComponent(pair.slice(crack + 1)).trim()
|
||||
})
|
||||
next()
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user