Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3e0e52b

Browse files
huacnleeJacksonTian
authored andcommitted
Fix sign error when user give a header, ensure to use stringify and downcase the header keys.
```rb client.request( method: "POST", uri: "/green/image/scan", headers: { "Content-Type" => "application/json" }, body: body ) ``` In this case, the headers will be `{ :"Content-Type" => "application/json" }`
1 parent 7baa4dc commit 3e0e52b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎lib/aliyunsdkcore/roa_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def initialize(config)
2020
end
2121

2222
def request(method:, uri:, params: {}, body: {}, headers: {}, options: {})
23-
23+
# :"Content-Type" => "application/json" to "content-type" => "application/json"
24+
headers.deep_transform_keys! { |key| key.to_s.downcase }
2425
mix_headers = default_headers.merge(headers)
2526

2627
response = connection.send(method.downcase) do |request|

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /