upyun-rb 0.0.3 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +20 -0
- data/README.md +4 -0
- data/lib/upyun-rb/bucket.rb +3 -3
- data/lib/upyun-rb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2716eff47a7192d560465a6aa4b8562ae62955d
|
4
|
+
data.tar.gz: 52bbb468289632bd39c2af4df851637bcd05b047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0be002248b5e3c5c39016965bdadedd7f1639813f9fb3614762fcddeb492576d7f539ea766c2e618721d0c1fead812e4037606719bbec3431261a0496a3f0396
|
7
|
+
data.tar.gz: 3c4becece2ef2ec296497ff6515d6baf4e39bee168e964681acb9cb6ab2227eedffaff990d7fe3870cfc6741212a92fac285c64c6753e8c0fec9c0966f1ec51d
|
data/LICENSE
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Larry Zhao
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
data/lib/upyun-rb/bucket.rb
CHANGED
@@ -18,14 +18,14 @@ module Upyun
|
|
18
18
|
date = Upyun::Util.current_date
|
19
19
|
mime_type = `file -Ib #{file}`.gsub(/\n/,"").split(';')[0]
|
20
20
|
file_size = file.nil? ? 0 : File.size(file)
|
21
|
-
sign = Digest::MD5.hexdigest("
|
21
|
+
sign = Digest::MD5.hexdigest("PUT&#{path}&#{date}&#{file_size}&#{@signed_password}")
|
22
22
|
|
23
23
|
@connection.put do |req|
|
24
24
|
req.url path
|
25
|
-
req.body = Faraday::UploadIO.new(file,
|
25
|
+
req.body = Faraday::UploadIO.new(file, mime_type)
|
26
26
|
req.headers['Content-Type'] = mime_type
|
27
27
|
req.headers['Content-Length'] = file_size.to_s
|
28
|
-
req.headers['Authorization'] = "UpYun #{
|
28
|
+
req.headers['Authorization'] = "UpYun #{@operator}:#{sign}"
|
29
29
|
req.headers['Date'] = date
|
30
30
|
req.headers['Expect'] = ''
|
31
31
|
end
|
data/lib/upyun-rb/version.rb
CHANGED