We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d258bb commit 005a145Copy full SHA for 005a145
src/OssClientServiceCollectionExtensions.cs
@@ -18,7 +18,10 @@ public static IServiceCollection AddOssClient(
18
Action<ClientConfiguration> setupClientConfiguration = null,
19
Action<HttpClient> configureHttpClient = null)
20
{
21
- services.Configure<OssCredential>(configuration.GetSection("ossClient"));
+ var section = (configuration as IConfigurationSection) == null ?
22
+ configuration.GetSection("ossClient") : configuration;
23
+
24
+ services.Configure<OssCredential>(section);
25
26
var clientConfiguration = new ClientConfiguration();
27
setupClientConfiguration?.Invoke(clientConfiguration);
0 commit comments