upyun-rb 0.0.10 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/upyun-rb/bucket.rb +13 -0
- data/lib/upyun-rb/version.rb +1 -1
- metadata +1 -1
data/lib/upyun-rb/bucket.rb
CHANGED
@@ -14,6 +14,19 @@ module Upyun
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
def head(path)
|
18
|
+
uri = "/#{@bucket}/#{path}"
|
19
|
+
date = Upyun::Util.current_date
|
20
|
+
sign = Digest::MD5.hexdigest("HEAD&#{uri}&#{date}&0&#{@signed_password}")
|
21
|
+
|
22
|
+
@connection.head do |req|
|
23
|
+
req.url uri
|
24
|
+
req.headers['Authorization'] = "UpYun #{@operator}:#{sign}"
|
25
|
+
req.headers['Date'] = date
|
26
|
+
req.headers['Expect'] = ''
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
17
30
|
def put(path, file)
|
18
31
|
uri = "/#{@bucket}/#{path}"
|
19
32
|
date = Upyun::Util.current_date
|
data/lib/upyun-rb/version.rb
CHANGED