Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Kestrel considers Connection: keep-alive, upgrade as non-upgrade request #1170

@analogrelay

Description

@analogrelay

Firefox sends it's WebSocket upgrade request with a Connection header value of keep-alive, Upgrade. Unfortunately MessageBody.For does a strict equality check (https://github.com/aspnet/KestrelHttpServer/blob/dev/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Http/MessageBody.cs#L237) which means the WebSocket request is assigned the ForContentLength version, with a content length of 0. As a result, the connection is considered terminated before it is even established and things go haywire (specifically the first attempt to Receive a message causes an exception because the underlying connection has been terminated).

We'll need to switch to either a Contains check or multiple Equals checks in order to ensure we're getting things right.

/cc @halter73

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions