收藏
回答

PC版微信公众号,下载临时素材图片时Content-Type发生错误(多公众号同时打开场景下复现)

PC版微信版本:3.9.2.26

同一个版本,有的同事只能打开一个公众号

有的可以同时打开多个公众号

在两种模式下调用获取临时素材接口下载图片https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID

打开一个公众号时:

 HttpResponseProxy{HTTP/1.1 200 OK [Connection: keep-alive, Cache-Control: no-cache, must-revalidate, Date: Wed, 10 May 2023 08:30:50 GMT, Content-disposition: attachment; filename="rea29Onhr95CMRNGYIdY1kGMBanZS4fCP5f1L7rcIYn3exAuJyFOYF1DRDQ0WgLK.jpg", Content-Type: image/jpeg, Content-Length: 96564] ResponseEntityProxy{[Content-Type: image/jpeg,Content-Length: 96564,Chunked: false]}}

打开多个公众号时:

HttpResponseProxy{HTTP/1.1 200 OK [Connection: keep-alive, Content-Type: text/plain, Date: Wed, 10 May 2023 07:59:42 GMT, Content-Length: 100] ResponseEntityProxy{[Content-Type: text/plain,Content-Length: 100,Chunked: false]}}


结果:在打开多个公众号模式时,下载相同的图片,原本获取素材接口返回类型从Content-Type: image/jpeg变成了Content-Type: text/plain

回答关注问题邀请回答
收藏
登录 后发表内容