Description
dotnet/runtime#48009 (comment)
HTTP/2 uses pseudo headers for special values like method, path, authority, scheme, etc., but they have lots of constraints about where they can be placed, only using reserved ones, etc..
https://tools.ietf.org/html/rfc7540#section-8.1.2.1
Pseudo-header fields are not HTTP header fields.
As a result, other http header APIs won't accept them as input. E.g. HttpRequestMessage, WebHeaderCollection, etc.. This means components that copy request headers from Kestrel have to filter these out.
// Filter out HTTP/2 pseudo headers like ":method" and ":path", those go into other fields.
if (headerName.Length > 0 && headerName[0] == ':')
{
continue;
}
if (header.Key.StartsWith(":")) // HTTP/2 pseudo header, skip as they appear on other properties of HttpRequest
continue;
Http.Sys and IIS also filter out pseudo headers.
Historically we thought we were being more transparent about the protocol by including these values, but I'm not aware of any situations where they have proven useful since they are duplicated elsewhere in the request.