Skip to content

Commit

Permalink
drop websocket hack
Browse files Browse the repository at this point in the history
  • Loading branch information
tocsoft committed Apr 12, 2023
1 parent 2e4b588 commit e214bcd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion KubeConnect/KubeConnect.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="Yarp.ReverseProxy" Version="1.1.1" />
<PackageReference Include="Yarp.ReverseProxy" Version="2.0.0" />
</ItemGroup>

</Project>
15 changes: 0 additions & 15 deletions KubeConnect/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();

app.Use((context, nxt) =>
{
if (context.Request.Method == HttpMethods.Connect && context.Request.Protocol != "HTTP/1.1")
{
var resetFeature = context.Features.Get<IHttpResetFeature>();
if (resetFeature != null)
{
//https://www.rfc-editor.org/rfc/rfc7540#page-51
//HTTP_1_1_REQUIRED (0xd): The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
resetFeature.Reset(errorCode: 0xd);
return Task.CompletedTask;
}
}
return nxt();
});
app.UseEndpoints(endpoints =>
{
endpoints.MapReverseProxy();
Expand Down

0 comments on commit e214bcd

Please sign in to comment.