From 10ea7e1fc6402d5fb5691ef825aff8f344879ce7 Mon Sep 17 00:00:00 2001 From: longbai Date: Thu, 27 Aug 2015 00:26:02 +0800 Subject: [PATCH 1/3] fixed null body for 2.4 --- src/main/java/com/qiniu/http/Client.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/qiniu/http/Client.java b/src/main/java/com/qiniu/http/Client.java index a127fba3c..87af4807f 100644 --- a/src/main/java/com/qiniu/http/Client.java +++ b/src/main/java/com/qiniu/http/Client.java @@ -98,21 +98,24 @@ public void accept(String key, Object value) { } public Response post(String url, byte[] body, StringMap headers, String contentType) throws QiniuException { - RequestBody rbody = null; + RequestBody rbody; if (body != null && body.length > 0) { MediaType t = MediaType.parse(contentType); - rbody = RequestBody.create(t, body); + }else{ + rbody = RequestBody.create(null, new byte[0]); } return post(url, rbody, headers); } public Response post(String url, byte[] body, int offset, int size, StringMap headers, String contentType) throws QiniuException { - RequestBody rbody = null; + RequestBody rbody; if (body != null && body.length > 0) { MediaType t = MediaType.parse(contentType); rbody = create(t, body, offset, size); + }else{ + rbody = RequestBody.create(null, new byte[0]); } return post(url, rbody, headers); } From e81376f931e334cafcba078860a1dc749c0b89da Mon Sep 17 00:00:00 2001 From: longbai Date: Thu, 27 Aug 2015 00:27:56 +0800 Subject: [PATCH 2/3] change log --- CHANGELOG.md | 8 ++++++++ src/main/java/com/qiniu/common/Config.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff29d019b..559c6de07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ #Changelog +## 7.0.4.1 (2015-08-27) + +### 修正 +* okhttp 2.4 兼容问题 + +### 变更 +* 多zone 支持 + ## 7.0.4 (2015-06-25) ### 变更 diff --git a/src/main/java/com/qiniu/common/Config.java b/src/main/java/com/qiniu/common/Config.java index 42f525e49..25ac95252 100644 --- a/src/main/java/com/qiniu/common/Config.java +++ b/src/main/java/com/qiniu/common/Config.java @@ -6,7 +6,7 @@ public final class Config { - public static final String VERSION = "7.0.4"; + public static final String VERSION = "7.0.4.1"; /** * 断点上传时的分块大小(默认的分块大小, 不允许改变) */ From 5371ef2587dfa1fd67d0e8f802fef3af87b449a7 Mon Sep 17 00:00:00 2001 From: longbai Date: Thu, 27 Aug 2015 01:00:00 +0800 Subject: [PATCH 3/3] format --- src/main/java/com/qiniu/http/Client.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/qiniu/http/Client.java b/src/main/java/com/qiniu/http/Client.java index 87af4807f..b17488ccc 100644 --- a/src/main/java/com/qiniu/http/Client.java +++ b/src/main/java/com/qiniu/http/Client.java @@ -102,7 +102,7 @@ public Response post(String url, byte[] body, StringMap headers, String contentT if (body != null && body.length > 0) { MediaType t = MediaType.parse(contentType); rbody = RequestBody.create(t, body); - }else{ + } else { rbody = RequestBody.create(null, new byte[0]); } return post(url, rbody, headers); @@ -114,7 +114,7 @@ public Response post(String url, byte[] body, int offset, int size, if (body != null && body.length > 0) { MediaType t = MediaType.parse(contentType); rbody = create(t, body, offset, size); - }else{ + } else { rbody = RequestBody.create(null, new byte[0]); } return post(url, rbody, headers);