mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-12-06 00:00:29 -05:00
Handle JSON.dump errors
This commit is contained in:
parent
b2401abbab
commit
b79f4c2417
@ -481,8 +481,18 @@ module Stripe
|
||||
payload = params
|
||||
end
|
||||
|
||||
# There's a bug in some version of activesupport where JSON.dump
|
||||
# stops working
|
||||
begin
|
||||
headers = { :x_stripe_client_user_agent => JSON.dump(ua) }.merge(headers)
|
||||
rescue => e
|
||||
headers = {
|
||||
:x_stripe_client_raw_user_agent => ua.inspect,
|
||||
:error => "#{e} (#{e.class})"
|
||||
}.merge(headers)
|
||||
end
|
||||
|
||||
headers = {
|
||||
:x_stripe_client_user_agent => JSON.dump(ua),
|
||||
:user_agent => "Stripe/v1 RubyBindings/#{Stripe::VERSION}"
|
||||
}.merge(headers)
|
||||
opts = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user