Skip to content

Commit de49818

Browse files
committed
fix: it needs a totally new httpclient
1 parent 74dc3f1 commit de49818

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Catglobe.CgScript.Deployment/HostExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ private static IServiceCollection AddCommonCgScript(IServiceCollection services)
3939
{
4040
services.TryAddSingleton<IScriptProvider, FilesFromDirectoryScriptProvider>();
4141
services.AddScoped<DeploymentAuthenticator>();
42-
services.AddScoped<DeploymentAuthHandler>();
4342
services.AddHttpClient<IDeployer, Deployer>((sp, httpClient) => {
4443
var site = sp.GetRequiredService<IOptions<DeploymentOptions>>().Value.Authority;
4544
httpClient.BaseAddress = new(site + "api/CgScriptDeployment/");
4645
})
4746
.AddHttpMessageHandler<DeploymentAuthHandler>();
47+
services.AddHttpClient<DeploymentAuthenticator>((sp, httpClient) => {
48+
httpClient.BaseAddress = sp.GetRequiredService<IOptions<DeploymentOptions>>().Value.Authority;
49+
});
4850
return services;
4951
}
5052
}

0 commit comments

Comments
 (0)