Skip to content

Commit cef33a2

Browse files
author
Howl王
committed
api update
1 parent c2ffab2 commit cef33a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/carrierwave/storage/qiniu.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def delete(key)
4848
end
4949

5050
def stat(key)
51-
::Qiniu::Storage.stat(@qiniu_bucket, key)
51+
code, result, response_headers = ::Qiniu::Storage.stat(@qiniu_bucket, key)
52+
code == 200 ? result : {}
5253
end
5354

5455
def download_url(path)
@@ -102,7 +103,7 @@ def content_type
102103
end
103104

104105
def size
105-
(file_info['fsize'] || 0).to_i
106+
file_info['fsize'] || 0
106107
end
107108

108109
private

0 commit comments

Comments
 (0)