lib: replace URI.encode by CGI.escape

URI.encode was removed in Ruby 3.

Fix an error when adding a phone number to a Helpscout ticket.
This commit is contained in:
Pierre de La Morinerie 2021-12-07 12:07:48 +01:00
parent 799ca8e499
commit c75dba701d

View file

@ -43,7 +43,7 @@ class Helpscout::API
end end
def add_phone_number(email, phone) def add_phone_number(email, phone)
query = URI.encode("(email:#{email})") query = CGI.escape("(email:#{email})")
response = call_api(:get, "#{CUSTOMERS}?mailbox=#{user_support_mailbox_id}&query=#{query}") response = call_api(:get, "#{CUSTOMERS}?mailbox=#{user_support_mailbox_id}&query=#{query}")
if response.success? if response.success?
body = parse_response_body(response) body = parse_response_body(response)