From f53dec3242fe7fc1c8e2d6237d3815461a333eed Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Tue, 14 Apr 2015 14:31:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AF=B9=E4=BA=8E=20appl?= =?UTF-8?q?ication/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 From 52057ff062c708b3f4b24e50fe743cfb8d8ebb69 Mon Sep 17 00:00:00 2001 From: Liang Tao Date: Mon, 24 Aug 2015 18:09:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=81=A2=E5=A4=8D=20exif=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=A6=86=E7=9B=96=20application/json;=20char?= =?UTF-8?q?set=3Dutf-8=20=E7=9A=84=E8=A7=A3=E6=9E=90=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/qiniu/image_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/qiniu/image_spec.rb b/spec/qiniu/image_spec.rb index 0002326..a93798f 100755 --- a/spec/qiniu/image_spec.rb +++ b/spec/qiniu/image_spec.rb @@ -59,14 +59,18 @@ module Qiniu end end -=begin context ".exif" do it "should works" do - code, data = Qiniu::Fop::Image.exif(@source_image_url) + result = Qiniu.get(@bucket, 'gogopher.jpg') + result["url"].should_not be_empty + puts result.inspect + + code, data, headers = Qiniu::Fop::Image.exif(result["url"]) + code.should == 200 puts data.inspect + puts headers.inspect end end -=end context ".mogrify_preview_url" do it "should works" do