File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
namespace Ocelot . Requester
11
11
{
12
+ public interface IHttpClientBuilder { }
13
+ public interface IHttpClientCache
14
+ {
15
+ IHttpClient Get ( DownstreamRoute cacheKey ) ;
16
+ void Set ( DownstreamRoute cacheKey , IHttpClient client , TimeSpan span ) ;
17
+ }
18
+
12
19
public class HttpClientBuilder : IHttpClientBuilder
13
20
{
14
21
private readonly IDelegatingHandlerHandlerFactory _factory ;
@@ -65,7 +72,7 @@ public IHttpClient Create(DownstreamRoute downstreamRoute)
65
72
Timeout = timeout ,
66
73
} ;
67
74
68
- _client = new HttpClientWrapper ( _httpClient , downstreamRoute . ConnectionClose ) ;
75
+ _client = new HttpClientWrapper ( _httpClient , downstreamRoute . ConnectionClose ) ; // TODO
69
76
70
77
return _client ;
71
78
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace Ocelot . Requester
6
6
{
7
+ public interface IHttpClient { }
8
+
7
9
/// <summary>
8
10
/// This class was made to make unit testing easier when HttpClient is used.
9
11
/// </summary>
10
12
public class HttpClientWrapper : IHttpClient
11
13
{
12
14
public HttpClient Client { get ; }
13
15
14
- public bool ConnectionClose { get ; }
16
+ public bool ConnectionClose { get ; } // TODO
15
17
16
18
public HttpClientWrapper ( HttpClient client , bool connectionClose = false )
17
19
{
18
20
Client = client ;
19
- ConnectionClose = connectionClose ;
21
+ ConnectionClose = connectionClose ; // TODO
20
22
}
21
23
22
24
public Task < HttpResponseMessage > SendAsync ( HttpRequestMessage request , CancellationToken cancellationToken = default )
23
25
{
24
- request . Headers . ConnectionClose = ConnectionClose ;
26
+ request . Headers . ConnectionClose = ConnectionClose ; // TODO
25
27
return Client . SendAsync ( request , cancellationToken ) ;
26
28
}
27
29
}
You can’t perform that action at this time.
0 commit comments