lib/createsend/createsend.rb in createsend-3.1.0 vs lib/createsend/createsend.rb in createsend-3.1.1
- old
+ new
@@ -75,10 +75,10 @@
# Refresh an OAuth access token, given an OAuth refresh token.
# Returns a new access token, 'expires in' value, and refresh token.
def self.refresh_access_token(refresh_token)
options = {
- :body => "grant_type=refresh_token&refresh_token=#{refresh_token}" }
+ :body => "grant_type=refresh_token&refresh_token=#{CGI.escape(refresh_token)}" }
response = HTTParty.post(@@oauth_token_uri, options)
if response.has_key? 'error' and response.has_key? 'error_description'
err = "Error refreshing access token: "
err << "#{response['error']} - #{response['error_description']}"
raise err
\ No newline at end of file