Skip to content

Commit b0b7f66

Browse files
committed
Keep old changes
1 parent e01f7a1 commit b0b7f66

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/Ocelot/Requester/HttpClientBuilder.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
namespace Ocelot.Requester
1111
{
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+
1219
public class HttpClientBuilder : IHttpClientBuilder
1320
{
1421
private readonly IDelegatingHandlerHandlerFactory _factory;
@@ -65,7 +72,7 @@ public IHttpClient Create(DownstreamRoute downstreamRoute)
6572
Timeout = timeout,
6673
};
6774

68-
_client = new HttpClientWrapper(_httpClient, downstreamRoute.ConnectionClose);
75+
_client = new HttpClientWrapper(_httpClient, downstreamRoute.ConnectionClose); // TODO
6976

7077
return _client;
7178
}

src/Ocelot/Requester/HttpClientWrapper.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44

55
namespace Ocelot.Requester
66
{
7+
public interface IHttpClient { }
8+
79
/// <summary>
810
/// This class was made to make unit testing easier when HttpClient is used.
911
/// </summary>
1012
public class HttpClientWrapper : IHttpClient
1113
{
1214
public HttpClient Client { get; }
1315

14-
public bool ConnectionClose { get; }
16+
public bool ConnectionClose { get; } // TODO
1517

1618
public HttpClientWrapper(HttpClient client, bool connectionClose = false)
1719
{
1820
Client = client;
19-
ConnectionClose = connectionClose;
21+
ConnectionClose = connectionClose; // TODO
2022
}
2123

2224
public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default)
2325
{
24-
request.Headers.ConnectionClose = ConnectionClose;
26+
request.Headers.ConnectionClose = ConnectionClose; // TODO
2527
return Client.SendAsync(request, cancellationToken);
2628
}
2729
}

0 commit comments

Comments
 (0)