Skip to content

Commit ecc415b

Browse files
Fixes server connection configuration.
Ensures the client uses the provided connection configuration or defaults to the service configuration. Adds logging to display the service configuration for debugging.
1 parent b445be2 commit ecc415b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Certify.Client/CertifyApiClient.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ public partial class CertifyApiClient : ICertifyInternalApiClient
7171
internal string _accessToken { get; set; } = "";
7272
internal string _refreshToken { get; set; } = "";
7373

74-
public CertifyApiClient(Providers.IServiceConfigProvider configProvider, Shared.ServerConnection config = null)
74+
public CertifyApiClient(Providers.IServiceConfigProvider configProvider, Shared.ServerConnection connectionConfig = null)
7575
{
7676
_configProvider = configProvider;
77-
_connectionConfig = config ?? GetDefaultServerConnection();
77+
78+
_connectionConfig = connectionConfig ?? GetDefaultServerConnection();
7879

7980
_baseUri = $"{(_connectionConfig.UseHTTPS ? "https" : "http")}://{_connectionConfig.Host}:{_connectionConfig.Port}" + _baseUri;
8081

@@ -129,6 +130,9 @@ private void SetClientAuthorizationBearerToken()
129130
public ServerConnection GetDefaultServerConnection()
130131
{
131132
var serviceCfg = _configProvider.GetServiceConfig();
133+
134+
System.Console.WriteLine($"CertifyApiClient: GetDefaultServerConnection service config: {serviceCfg?.Host}:{serviceCfg?.Port} ({serviceCfg?.UseHTTPS} {serviceCfg.ServiceFaultMsg})");
135+
132136
return new ServerConnection(serviceCfg);
133137
}
134138

0 commit comments

Comments
 (0)