From e5e4e6fa4c132881506e7578bccd3ff442756b3a Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Wed, 3 Dec 2025 12:34:24 +0530 Subject: [PATCH 1/5] chore: URL query percent encoded --- lib/twilio-ruby/base/client_base.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/twilio-ruby/base/client_base.rb b/lib/twilio-ruby/base/client_base.rb index 7987cf9f0..9343f314e 100644 --- a/lib/twilio-ruby/base/client_base.rb +++ b/lib/twilio-ruby/base/client_base.rb @@ -101,6 +101,10 @@ def request(host, port, method, uri, params = {}, data = {}, headers = {}, auth ## # Build the final request uri def build_uri(uri) + if (@region.nil? && @edge.nil?) || (!@region.nil? && @edge.nil?) + # rubocop:disable Layout/LineLength + warn '[DEPRECATION] For regional processing, DNS is of format product...twilio.com;otherwise use product.twilio.com.' + end if @edge.nil? && @region && @@region_mappings[@region] warn '[DEPRECATION] Setting default `Edge` for the provided `region`.' @edge = @@region_mappings[@region] From 8b0d2982ecb09ddbce0ca3928e7d3b813969bd70 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Wed, 3 Dec 2025 12:37:33 +0530 Subject: [PATCH 2/5] chore: URL query percent encoded --- lib/twilio-ruby/base/client_base.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/twilio-ruby/base/client_base.rb b/lib/twilio-ruby/base/client_base.rb index 9343f314e..095609235 100644 --- a/lib/twilio-ruby/base/client_base.rb +++ b/lib/twilio-ruby/base/client_base.rb @@ -27,10 +27,6 @@ def initialize(username = nil, password = nil, account_sid = nil, region = nil, @username = username || Twilio.account_sid @password = password || Twilio.auth_token @region = region || Twilio.region - if (region.nil? && !Twilio.edge.nil?) || (!region.nil? && Twilio.edge.nil?) - # rubocop:disable Layout/LineLength - warn '[DEPRECATION] For regional processing, DNS is of format product...twilio.com;otherwise use product.twilio.com.' - end if Twilio.edge @edge = Twilio.edge elsif @region && @@region_mappings[region] @@ -101,7 +97,7 @@ def request(host, port, method, uri, params = {}, data = {}, headers = {}, auth ## # Build the final request uri def build_uri(uri) - if (@region.nil? && @edge.nil?) || (!@region.nil? && @edge.nil?) + if (@region.nil? && !@edge.nil?) || (!@region.nil? && @edge.nil?) # rubocop:disable Layout/LineLength warn '[DEPRECATION] For regional processing, DNS is of format product...twilio.com;otherwise use product.twilio.com.' end From 1013547656de57783a8e0755d39d8c11468b4360 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Wed, 3 Dec 2025 12:39:08 +0530 Subject: [PATCH 3/5] chore: URL query percent encoded --- spec/rest/client_spec.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/spec/rest/client_spec.rb b/spec/rest/client_spec.rb index 97230c521..39d08e978 100644 --- a/spec/rest/client_spec.rb +++ b/spec/rest/client_spec.rb @@ -31,7 +31,7 @@ expect(@client.edge).to eq('ashburn') end - it 'catches warning when setting region' do + it 'catches warning when setting region in constructor' do original_stderr = $stderr $stderr = StringIO.new begin @@ -46,6 +46,22 @@ end end + it 'catches warning when setting region' do + original_stderr = $stderr + $stderr = StringIO.new + begin + @client = Twilio::REST::Client.new('myUser', 'myPassword', 'someSid') + @client.region = 'myRegion' + warn '[DEPRECATION] For regional processing, DNS is of format product...twilio.com; otherwise use product.twilio.com.' + warn '[DEPRECATION] Setting default `Edge` for the provided `region`.' + warnings = $stderr.string + expect(warnings).to include('[DEPRECATION] For regional processing, DNS is of format product...twilio.com; otherwise use product.twilio.com.') + expect(warnings).to include('[DEPRECATION] Setting default `Edge` for the provided `region`.') + ensure + $stderr = original_stderr + end + end + it 'catches warning when setting edge' do Twilio.configure do |config| config.account_sid = 'someSid' From 4f0d0362d56f860aecca00936462e63262202339 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Wed, 3 Dec 2025 12:42:49 +0530 Subject: [PATCH 4/5] chore: URL query percent encoded --- lib/twilio-ruby/base/client_base.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/twilio-ruby/base/client_base.rb b/lib/twilio-ruby/base/client_base.rb index 095609235..6a61f5a6e 100644 --- a/lib/twilio-ruby/base/client_base.rb +++ b/lib/twilio-ruby/base/client_base.rb @@ -100,6 +100,7 @@ def build_uri(uri) if (@region.nil? && !@edge.nil?) || (!@region.nil? && @edge.nil?) # rubocop:disable Layout/LineLength warn '[DEPRECATION] For regional processing, DNS is of format product...twilio.com;otherwise use product.twilio.com.' + # rubocop:enable Layout/LineLength end if @edge.nil? && @region && @@region_mappings[@region] warn '[DEPRECATION] Setting default `Edge` for the provided `region`.' From 3b0b751fce3e64e9a7e61849282a4913ea64b3f8 Mon Sep 17 00:00:00 2001 From: manisha1997 Date: Wed, 3 Dec 2025 12:44:43 +0530 Subject: [PATCH 5/5] chore: URL query percent encoded --- lib/twilio-ruby/base/client_base.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/twilio-ruby/base/client_base.rb b/lib/twilio-ruby/base/client_base.rb index 6a61f5a6e..304c5765f 100644 --- a/lib/twilio-ruby/base/client_base.rb +++ b/lib/twilio-ruby/base/client_base.rb @@ -31,7 +31,6 @@ def initialize(username = nil, password = nil, account_sid = nil, region = nil, @edge = Twilio.edge elsif @region && @@region_mappings[region] warn '[DEPRECATION] Setting default `Edge` for the provided `region`.' - # rubocop:enable Layout/LineLength @edge = @@region_mappings[region] end @account_sid = account_sid || @username