Skip to content

Commit 3e2adf0

Browse files
committed
fixup! Use endpoint as default connection option (ADR-119)
1 parent 7c299cc commit 3e2adf0

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

lib/ably/realtime/client.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class Client
1414
extend Forwardable
1515
using Ably::Util::AblyExtensions
1616

17-
DOMAIN = 'main.realtime.ably.net'
18-
1917
# A {Aby::Realtime::Channels} object.
2018
#
2119
# @spec RTC3, RTS1

lib/ably/rest/client.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ class Client
1818
extend Forwardable
1919
using Ably::Util::AblyExtensions
2020

21-
# Default Ably domain for REST
22-
DOMAIN = 'main.realtime.ably.net'
23-
2421
MAX_MESSAGE_SIZE = 65536 # See spec TO3l8
2522
MAX_FRAME_SIZE = 524288 # See spec TO3l8
2623

@@ -221,12 +218,10 @@ def initialize(options)
221218
options_fallback_hosts
222219
when custom_host || options[:realtime_host] || custom_port || custom_tls_port
223220
[]
224-
when endpoint
225-
if endpoint.start_with?('nonprod:')
226-
CUSTOM_ENVIRONMENT_FALLBACKS_SUFFIXES.map { |host| "#{endpoint.gsub('nonprod:', '')}.#{host}" }
227-
else
228-
CUSTOM_ENVIRONMENT_FALLBACKS_SUFFIXES.map { |host| "#{endpoint}.#{host}" }
229-
end
221+
when endpoint.start_with?('nonprod:')
222+
CUSTOM_ENVIRONMENT_FALLBACKS_SUFFIXES.map { |host| "#{endpoint.gsub('nonprod:', '')}.#{host}" }
223+
when endpoint != 'main'
224+
CUSTOM_ENVIRONMENT_FALLBACKS_SUFFIXES.map { |host| "#{endpoint}.#{host}" }
230225
else
231226
Ably::FALLBACK_HOSTS
232227
end

0 commit comments

Comments
 (0)