mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-04 02:32:09 +08:00
Merge pull request #1315 from syhan/syhan-patch-1
Fix the wrong cookie split regex
This commit is contained in:
commit
359ca4c538
2
app.js
2
app.js
@ -41,7 +41,7 @@ app.use((req, res, next) => {
|
||||
app.use((req, res, next) => {
|
||||
req.cookies = {}
|
||||
//;(req.headers.cookie || '').split(/\s*;\s*/).forEach((pair) => { // Polynomial regular expression //
|
||||
;(req.headers.cookie || '').split(/^\s+|(?<!\s)\s+$/g).forEach((pair) => {
|
||||
(req.headers.cookie || '').split(/;\s+|(?<!\s)\s+$/g).forEach((pair) => {
|
||||
let crack = pair.indexOf('=')
|
||||
if (crack < 1 || crack == pair.length - 1) return
|
||||
req.cookies[decodeURIComponent(pair.slice(0, crack)).trim()] =
|
||||
|
Loading…
x
Reference in New Issue
Block a user