Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BlobApi
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
BlobApi
Commits
a3d6ce58
Commit
a3d6ce58
authored
Jul 7, 2022
by
L. Ellenbeck
Committed by
Petar Hristov
Jul 7, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Fix: added HttpClientFactory (coscine/issues#2141)
parent
41d9fdd1
No related branches found
No related tags found
1 merge request
!68
Fix: added HttpClientFactory (coscine/issues#2141)
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Blob/Blob.csproj
+1
-1
1 addition, 1 deletion
src/Blob/Blob.csproj
src/Blob/Startup.cs
+19
-1
19 additions, 1 deletion
src/Blob/Startup.cs
with
20 additions
and
2 deletions
src/Blob/Blob.csproj
+
1
−
1
View file @
a3d6ce58
...
...
@@ -21,6 +21,6 @@
<PackageReference Include="Coscine.Metadata" Version="2.*-*" />
<PackageReference Include="Coscine.Database" Version="2.*-*" />
<PackageReference Include="Coscine.Logging" Version="2.*-*" />
<PackageReference Include="Coscine.ResourceTypes" Version="*-*" />
<PackageReference Include="Coscine.ResourceTypes" Version="
1.
*-*" />
</ItemGroup>
</Project>
This diff is collapsed.
Click to expand it.
src/Blob/Startup.cs
+
19
−
1
View file @
a3d6ce58
using
Coscine.ApiCommons
;
using
Coscine.ResourceTypes
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.DependencyInjection
;
using
System
;
using
System
.Net.Http
;
namespace
Coscine.Api.Blob
{
...
...
@@ -23,6 +26,21 @@ namespace Coscine.Api.Blob
public
override
void
ConfigureServicesExtension
(
IServiceCollection
services
)
{
base
.
ConfigureServicesExtension
(
services
);
services
.
AddHttpClient
();
}
/// <summary>
/// Add HttpClinetFactory to resource types
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public
override
void
ConfigureExtensionLate
(
IApplicationBuilder
app
,
IWebHostEnvironment
env
)
{
base
.
ConfigureExtensionLate
(
app
,
env
);
using
var
scope
=
app
.
ApplicationServices
.
CreateScope
();
ResourceTypeFactory
.
HttpClientFactory
=
scope
.
ServiceProvider
.
GetRequiredService
<
IHttpClientFactory
>();
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment