From c9d8351d46a9136710e4d0559c39e3f4ec5f46ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A4=E7=8B=90=E5=86=B2?= <597478495@qq.com> Date: Tue, 26 Dec 2023 23:17:34 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20#3196=20=E3=80=90=E5=85=AC=E4=BC=97?= =?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E5=A4=8DmaterialImageOrVoiceDownloa?= =?UTF-8?q?d=E6=8E=A5=E5=8F=A3=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=88=B7=E6=96=B0AccessToken=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialVoiceAndImageDownloadOkhttpRequestExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialVoiceAndImageDownloadOkhttpRequestExecutor.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialVoiceAndImageDownloadOkhttpRequestExecutor.java index 217ae3d21..ba2f36967 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialVoiceAndImageDownloadOkhttpRequestExecutor.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/util/requestexecuter/material/MaterialVoiceAndImageDownloadOkhttpRequestExecutor.java @@ -35,7 +35,7 @@ public class MaterialVoiceAndImageDownloadOkhttpRequestExecutor extends Material Request request = new Request.Builder().url(uri).get().post(requestBody).build(); Response response = client.newCall(request).execute(); String contentTypeHeader = response.header("Content-Type"); - if ("text/plain".equals(contentTypeHeader)) { + if ("text/plain".equals(contentTypeHeader) || "application/json; charset=utf-8".equals(contentTypeHeader)) { String responseContent = response.body().string(); throw new WxErrorException(WxError.fromJson(responseContent, WxType.MP)); }