null检测
This commit is contained in:
parent
8786e97201
commit
33197ec838
@ -1,12 +1,13 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>2.0.4</Version>
|
<Version>2.0.5</Version>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Description>github加速神器</Description>
|
<Description>github加速神器</Description>
|
||||||
<Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
|
<Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
<TargetFramework>net5.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
|
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||||
|
|||||||
@ -88,8 +88,12 @@ namespace FastGithub.HttpServer
|
|||||||
using var targetSocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
|
using var targetSocket = new Socket(SocketType.Stream, ProtocolType.Tcp);
|
||||||
await targetSocket.ConnectAsync(endpoint);
|
await targetSocket.ConnectAsync(endpoint);
|
||||||
|
|
||||||
|
var responseFeature = context.Features.Get<IHttpResponseFeature>();
|
||||||
|
if (responseFeature != null)
|
||||||
|
{
|
||||||
|
responseFeature.ReasonPhrase = "Connection Established";
|
||||||
|
}
|
||||||
context.Response.StatusCode = StatusCodes.Status200OK;
|
context.Response.StatusCode = StatusCodes.Status200OK;
|
||||||
context.Features.Get<IHttpResponseFeature>().ReasonPhrase = "Connection Established";
|
|
||||||
await context.Response.CompleteAsync();
|
await context.Response.CompleteAsync();
|
||||||
|
|
||||||
var transport = context.Features.Get<IConnectionTransportFeature>()?.Transport;
|
var transport = context.Features.Get<IConnectionTransportFeature>()?.Transport;
|
||||||
@ -144,7 +148,7 @@ namespace FastGithub.HttpServer
|
|||||||
/// <param name="host"></param>
|
/// <param name="host"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private async Task<EndPoint> GetTargetEndPointAsync(HostString host)
|
private async Task<EndPoint> GetTargetEndPointAsync(HostString host)
|
||||||
{
|
{
|
||||||
var targetHost = host.Host;
|
var targetHost = host.Host;
|
||||||
var targetPort = host.Port ?? HTTPS_PORT;
|
var targetPort = host.Port ?? HTTPS_PORT;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.31507.150
|
VisualStudioVersion = 17.0.31808.319
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub", "FastGithub\FastGithub.csproj", "{C1099390-6103-4917-A740-A3002B542FE0}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub", "FastGithub\FastGithub.csproj", "{C1099390-6103-4917-A740-A3002B542FE0}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user