aliyunsdkcore 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aliyunsdkcore.rb +1 -1
- data/lib/aliyunsdkcore/roa_client.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db440cd806945cb8cfac4ac73dbeb07483105a899209211bf17d29204a89e78a
|
4
|
+
data.tar.gz: f2863a87f8c8c32d41a3113b645da0e5c2901c60f72367227e95bcd4ecb9fa02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d0eb4550ef766cbcc24a377eb179c602b80b77270062eef8726bf21521a98793614ab5bb74dc0491781d382c2129c360333d9e54f0296aa24edc5b75024917
|
7
|
+
data.tar.gz: 108a4cf118ad66f18b83bce4cd082eaadedd92e8c394a31c0a8a503e36c72ce28ffb2c5d7a3e8dfc3b0ce39dc17c52c92e2c2717a9dbbd5b409bbca2767adbc0
|
data/lib/aliyunsdkcore.rb
CHANGED
@@ -2,7 +2,7 @@ require 'aliyunsdkcore/rpc_client'
|
|
2
2
|
require 'aliyunsdkcore/roa_client'
|
3
3
|
|
4
4
|
module AliyunSDKCore
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.13"
|
6
6
|
DEFAULT_UA = "AlibabaCloud (#{Gem::Platform.local.os}; " +
|
7
7
|
"#{Gem::Platform.local.cpu}) Ruby/#{RUBY_VERSION} Core/#{VERSION}"
|
8
8
|
end
|
@@ -26,11 +26,17 @@ module AliyunSDKCore
|
|
26
26
|
|
27
27
|
response = connection.send(method.downcase) do |request|
|
28
28
|
request.url uri, params
|
29
|
-
if body
|
30
|
-
|
31
|
-
|
29
|
+
if body
|
30
|
+
if mix_headers['content-type'].start_with? 'application/json'
|
31
|
+
request_body = body.to_json
|
32
|
+
elsif mix_headers['content-type'].start_with? 'application/x-www-form-urlencoded'
|
33
|
+
request_body = URI.encode_www_form(body)
|
34
|
+
else
|
35
|
+
request_body = body
|
36
|
+
end
|
32
37
|
mix_headers['content-md5'] = Digest::MD5.base64digest request_body
|
33
38
|
mix_headers['content-length'] = request_body.length.to_s
|
39
|
+
request.body = request_body
|
34
40
|
end
|
35
41
|
string2sign = string_to_sign(method, uri, mix_headers, params)
|
36
42
|
mix_headers.merge!(authorization: authorization(string2sign))
|