mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2025-10-22 14:43:10 +00:00
fix(typeerror): 尝试修复vercel调用 500错误
This commit is contained in:
parent
f9f6db3fee
commit
2cbd17a6d7
@ -208,7 +208,9 @@ async function consturctServer(moduleDefs) {
|
|||||||
// Register the route.
|
// Register the route.
|
||||||
app.use(moduleDef.route, async (req, res) => {
|
app.use(moduleDef.route, async (req, res) => {
|
||||||
;[req.query, req.body].forEach((item) => {
|
;[req.query, req.body].forEach((item) => {
|
||||||
if (typeof item.cookie === 'string') {
|
// item may be undefined (some environments / middlewares).
|
||||||
|
// Guard access to avoid "Cannot read properties of undefined (reading 'cookie')".
|
||||||
|
if (item && typeof item.cookie === 'string') {
|
||||||
item.cookie = cookieToJson(decode(item.cookie))
|
item.cookie = cookieToJson(decode(item.cookie))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user