#356 修复QrCodeRequestExecutor类MimeType比较的bug

This commit is contained in:
Binary Wang
2017-10-18 12:27:11 +08:00
parent 64f0e7cf6b
commit 0f007d970b
3 changed files with 8 additions and 5 deletions

View File

@ -48,7 +48,8 @@ public class QrCodeRequestExecutor implements RequestExecutor<File, AbstractWxMa
InputStream inputStream = InputStreamResponseHandler.INSTANCE.handleResponse(response);) {
Header[] contentTypeHeader = response.getHeaders("Content-Type");
if (contentTypeHeader != null && contentTypeHeader.length > 0
&& ContentType.APPLICATION_JSON.getMimeType().equals(contentTypeHeader[0].getValue())) {
&& ContentType.APPLICATION_JSON.getMimeType()
.equals(ContentType.parse(contentTypeHeader[0].getValue()).getMimeType())) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
throw new WxErrorException(WxError.fromJson(responseContent));
}