提交 ec21f060 编写于 作者: B binaryify 提交者: GitHub

Merge pull request #336 from kouchao/master

修复非法参数403 #335, 修复代理错误 #334
module.exports = (req, res, createWebAPIRequest) => {
let cookie = req.get('Cookie') ? req.get('Cookie') : ''
cookie += ';os=pc;'
cookie = 'os=pc;' + cookie
const rid = req.query.id
const typeMap = {
0: 'R_SO_4_', // 歌曲
......
//comment like
module.exports = (req, res, createWebAPIRequest, request) => {
let cookie = req.get('Cookie') ? req.get('Cookie') : ''
cookie += ';os=pc;'
cookie = 'os=pc;' + cookie
const cid = req.query.cid //评论 id
const id = req.query.id
const typeMap = {
......
......@@ -39,13 +39,13 @@ function createWebAPIRequest(
callback,
errorCallback
) {
const proxy = cookie.split('__proxy__')[1]
cookie = cookie.split('__proxy__')[0]
const csrfToken = cookie.match(/_csrf=([^(;|$)]+)/)
if (csrfToken) data.csrf_token = csrfToken[1]
else data.csrf_token = ''
const proxy = cookie.split('__proxy__')[1]
cookie = cookie.split('__proxy__')[0]
const encryptedData = Encrypt(data)
const options = {
url: `http://${host}${path}`,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册