Binaryify/NeteaseCloudMusicApi

请求内容不转义真的能用

huhuime opened this issue · 1 comments

环境

系统: win7 x64

nodejs 版本:
v6.3.0

出现问题

高概率响应结果出现'content-length': '0'
请求的内容存在问题

重现步骤

正常请求

期待效果

响应结果不出现'content-length': '0'

存在的bug

NeteaseCloudMusicApi/util/util.js 第46行 http_client.write('params=' + cryptoreq.params + '&encSecKey=' + cryptoreq.encSecKey)

缺少对请求内容转义 “=”、“+”这些肯定要转义的

建议

1、使用querystring的stringify
2、替换= + 为转义符,不然代码中存在设计到重发直到组合数据中不再出现+和= 或者浏览器等待超时

改成这样了,应该没问题了吧
image