Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 9d5ac48

Browse files
Rename the new ConditionalProxy to SpaProxy, since it's not always 'conditional' any more. This is internal, so the name change is fine.
1 parent 1f35e54 commit 9d5ac48

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/ConditionalProxyMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public ConditionalProxyMiddleware(
3939
_pathPrefix = pathPrefix;
4040
_pathPrefixIsRoot = string.Equals(_pathPrefix, "/", StringComparison.Ordinal);
4141
_baseUriTask = baseUriTask;
42-
_httpClient = ConditionalProxy.CreateHttpClientForProxy(requestTimeout);
42+
_httpClient = SpaProxy.CreateHttpClientForProxy(requestTimeout);
4343
_applicationStoppingToken = applicationLifetime.ApplicationStopping;
4444
}
4545

4646
public async Task Invoke(HttpContext context)
4747
{
4848
if (context.Request.Path.StartsWithSegments(_pathPrefix) || _pathPrefixIsRoot)
4949
{
50-
var didProxyRequest = await ConditionalProxy.PerformProxyRequest(
50+
var didProxyRequest = await SpaProxy.PerformProxyRequest(
5151
context, _httpClient, _baseUriTask, _applicationStoppingToken, proxy404s: false);
5252
if (didProxyRequest)
5353
{

src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/ConditionalProxy.cs renamed to src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxy.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace Microsoft.AspNetCore.SpaServices.Extensions.Proxy
1515
{
1616
// This duplicates and updates the proxying logic in SpaServices so that we can update
1717
// the project templates without waiting for 2.1 to ship. When 2.1 is ready to ship,
18-
// merge the additional proxying features (e.g., proxying websocket connections) back
19-
// into the SpaServices proxying code. It's all internal.
20-
internal static class ConditionalProxy
18+
// remove the old ConditionalProxy.cs from SpaServices and replace its usages with this.
19+
// Doesn't affect public API surface - it's all internal.
20+
internal static class SpaProxy
2121
{
2222
private const int DefaultWebSocketBufferSize = 4096;
2323
private const int StreamCopyBufferSize = 81920;

src/Microsoft.AspNetCore.SpaServices.Extensions/Proxying/SpaProxyingExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public static void UseProxyToSpaDevelopmentServer(
4848
// server-sent event endpoints or similar, where it's expected that the response
4949
// takes an unlimited time and never actually completes
5050
var neverTimeOutHttpClient =
51-
ConditionalProxy.CreateHttpClientForProxy(Timeout.InfiniteTimeSpan);
51+
SpaProxy.CreateHttpClientForProxy(Timeout.InfiniteTimeSpan);
5252

5353
// Proxy all requests into the Angular CLI server
5454
applicationBuilder.Use(async (context, next) =>
5555
{
56-
var didProxyRequest = await ConditionalProxy.PerformProxyRequest(
56+
var didProxyRequest = await SpaProxy.PerformProxyRequest(
5757
context, neverTimeOutHttpClient, baseUriTask, applicationStoppingToken,
5858
proxy404s: true);
5959
});

0 commit comments

Comments
 (0)