diff --git a/Makefile b/Makefile index 57243f670..2a40b23a1 100644 --- a/Makefile +++ b/Makefile @@ -35,3 +35,6 @@ docker-push: cluster-test: bundle exec rspec ./cluster_spec.rb + +prettier: + bundle exec rubocop -A -d --cache true --parallel diff --git a/lib/twilio-ruby/base/client_base.rb b/lib/twilio-ruby/base/client_base.rb index 9b8460b5e..e89892cf5 100644 --- a/lib/twilio-ruby/base/client_base.rb +++ b/lib/twilio-ruby/base/client_base.rb @@ -111,7 +111,10 @@ def generate_headers(method, headers) user_agent_extensions.each { |extension| headers['User-Agent'] += " #{extension}" } - headers['Content-Type'] = 'application/x-www-form-urlencoded' if method == 'POST' && !headers['Content-Type'] + if ['POST', 'PUT'].include?(method) && !headers['Content-Type'] + headers['Content-Type'] = + 'application/x-www-form-urlencoded' + end headers['Accept'] = 'application/json' unless headers['Accept'] headers