upyun-rb 0.0.10 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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