diff --git a/Directory.Build.props b/Directory.Build.props index 7724f9e..e4073a7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,13 @@ - 2.0.4 + 2.0.5 enable github加速神器 https://github.com/dotnetcore/FastGithub win-x64 - net5.0 + net6.0 true + true diff --git a/FastGithub.HttpServer/HttpProxyMiddleware.cs b/FastGithub.HttpServer/HttpProxyMiddleware.cs index 5bbb441..e380191 100644 --- a/FastGithub.HttpServer/HttpProxyMiddleware.cs +++ b/FastGithub.HttpServer/HttpProxyMiddleware.cs @@ -88,8 +88,12 @@ namespace FastGithub.HttpServer using var targetSocket = new Socket(SocketType.Stream, ProtocolType.Tcp); await targetSocket.ConnectAsync(endpoint); + var responseFeature = context.Features.Get(); + if (responseFeature != null) + { + responseFeature.ReasonPhrase = "Connection Established"; + } context.Response.StatusCode = StatusCodes.Status200OK; - context.Features.Get().ReasonPhrase = "Connection Established"; await context.Response.CompleteAsync(); var transport = context.Features.Get()?.Transport; @@ -144,7 +148,7 @@ namespace FastGithub.HttpServer /// /// private async Task GetTargetEndPointAsync(HostString host) - { + { var targetHost = host.Host; var targetPort = host.Port ?? HTTPS_PORT; diff --git a/FastGithub.sln b/FastGithub.sln index af46f5e..0e19d20 100644 --- a/FastGithub.sln +++ b/FastGithub.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31507.150 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31808.319 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub", "FastGithub\FastGithub.csproj", "{C1099390-6103-4917-A740-A3002B542FE0}" EndProject