Skip to content

Adding a new Enhanced Connect :protocol pseudo-header #42002

Closed
@Daniel-Genkin-MS-2

Description

@Daniel-Genkin-MS-2

Background and Motivation

I would like to propose adding a new protocol pseudo-header to HeaderNames. This will be helpful for adding support for new protocols to the stack that use the new Enhanced CONNECT method (e.g WebTransport (#41877) or WebSockets over HTTP/2 (#41558)). Currently there isn't such a pseudo-header. Therefore, we would need to hardcode it in the code currently. This proposed change would abstract the actual value into the HeaderNames file and thus help with maintainability as well as keep it more consistent with how the repo handles all the other headers and pseudo-headers.

Proposed API

/// <summary>Gets the <c>Protocol</c> HTTP header name.</summary>
public static readonly string Protocol = ":protocol";

Usage Examples

HeaderNames.Protocol

Alternative Designs

As this is a very tiny change, the only other reasonable possible designs are just to rename the variable or to place it in some other file. The proposed name, Protocol, seems to be the most consistent with the other values that are already defined and seems like all the pseudo-headers are already defined in this HeaderNames.cs file.

Risks

I don't think there are any risks here besides maybe choosing a bad variable name and confusing the customers who try to use it.

Metadata

Metadata

Labels

api-needs-workAPI needs work before it is approved, it is NOT ready for implementationarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions