From f53dec3242fe7fc1c8e2d6237d3815461a333eed Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Tue, 14 Apr 2015 14:31:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AF=B9=E4=BA=8E=20applicat?= =?UTF-8?q?ion/json;=20charset=3Dutf-8=20=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/qiniu/http.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qiniu/http.rb b/lib/qiniu/http.rb index 0f7004d..f5b8a10 100755 --- a/lib/qiniu/http.rb +++ b/lib/qiniu/http.rb @@ -65,7 +65,7 @@ module Qiniu end content_type = resp_headers["content-type"][0] - if !content_type.nil? && content_type == API_RESULT_MIMETYPE then + if !content_type.nil? && !content_type.downcase.index(API_RESULT_MIMETYPE).nil? then # 如果是JSON格式,则反序列化 resp_body = Utils.safe_json_parse(resp_body) end @@ -117,7 +117,7 @@ module Qiniu end content_type = resp_headers["content-type"][0] - if !content_type.nil? && content_type == API_RESULT_MIMETYPE then + if !content_type.nil? && !content_type.downcase.index(API_RESULT_MIMETYPE).nil? then # 如果是JSON格式,则反序列化 resp_body = Utils.safe_json_parse(resp_body) end