File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ var defaultOptions = clientOptions{
6363 LogLevel : LogWarning , // RSC2
6464}
6565
66+ var nonprodRegexp = regexp .MustCompile (`^nonprod:(.*)$` )
67+
6668func defaultFallbackHosts () []string {
6769 return endpointFallbacks ("main" , "ably-realtime.com" )
6870}
6971
7072func getEndpointFallbackHosts (endpoint string ) []string {
71- if match := regexp . MustCompile ( `^nonprod:(.*)$` ) .FindStringSubmatch (endpoint ); match != nil {
73+ if match := nonprodRegexp .FindStringSubmatch (endpoint ); match != nil {
7274 namespace := match [1 ]
7375 return endpointFallbacks (namespace , "ably-realtime-nonprod.com" )
7476 }
@@ -504,7 +506,7 @@ func (opts *clientOptions) getEndpoint() string {
504506 return endpoint
505507 }
506508
507- if match := regexp . MustCompile ( `^nonprod:(.*)$` ) .FindStringSubmatch (endpoint ); match != nil {
509+ if match := nonprodRegexp .FindStringSubmatch (endpoint ); match != nil {
508510 namespace := match [1 ]
509511 return fmt .Sprintf ("%s.realtime.ably-nonprod.net" , namespace )
510512 }
You can’t perform that action at this time.
0 commit comments