Skip to content

Commit 69ed5c3

Browse files
committed
Merge branch '431_issue_v1_4_11' into '1-4-stable'
Fix issue 431 in v1-stable See merge request oauth-xx/oauth2!637
2 parents d41fb6e + 2466989 commit 69ed5c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/oauth2/client.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ def get_token(params, access_token_opts = {}, extract_access_token = options[:ex
166166
opts = {:raise_errors => options[:raise_errors], :parse => params.delete(:parse)}
167167
headers = params.delete(:headers) || {}
168168
if options[:token_method] == :post
169-
opts[:body] = params
169+
opts[:body] = if headers['Content-Type'] == 'application/json'
170+
params.to_json
171+
else
172+
params
173+
end
170174
opts[:headers] = {'Content-Type' => 'application/x-www-form-urlencoded'}
171175
else
172176
opts[:params] = params

0 commit comments

Comments
 (0)