Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] 下载永久素材时,微信返回的Content-Type不正确,导致出错。 #290

Closed
chao opened this issue Feb 18, 2016 · 4 comments

Comments

@chao
Copy link

chao commented Feb 18, 2016

刚发现微信接口在下载永久素材时(素材类型为video, image, voice)的,用get($mediaId)方法下载时服务器返回的Content-Type居然是Content-Type: text/plain

这样导致Material.php里的get($mediaId)方法无法返回整个request body。而是开始parseJSON。而parseJSON返回的结果是false,所以在checkAndThrow就出错了。

不知道这个获取永久素材时的content-type不正确是我的个别现象还是普遍现象。

overtrue added a commit that referenced this issue Feb 18, 2016
@overtrue
Copy link
Collaborator

在我发布新版之前你可以先按我的代码变更修改用着

@hareluya
Copy link

而且下载下来的音频是压缩过的,完全不能放。
视频则是下不来的。。。

@overtrue
Copy link
Collaborator

@hareluya 这...

@chao
Copy link
Author

chao commented Feb 19, 2016

微信确实太操蛋,不仅不给文件名,还连正确content type 都不给。

@hareluya 视频给链接其实是一个页面,真要下载只有自己解析内容,抓取了。。。。

@chao chao closed this as completed Feb 19, 2016
overtrue added a commit that referenced this issue Feb 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants