Have kestrel filter out pseudo headers #30417
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
bug
This issue describes a behavior which is not expected - a bug.
HTTP2
HTTP3
Milestone
Uh oh!
There was an error while loading. Please reload this page.
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
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.
https://github.com/microsoft/reverse-proxy/blob/a3247ba1168325f46ab0ee4a24d3de1d9acdd853/src/ReverseProxy/Service/Proxy/HttpTransformer.cs#L49-L53
https://github.com/CoreWCF/CoreWCF/blob/9957bb14bede95c22a8c6c7b3be4e42e84ba8471/src/CoreWCF.Http/src/CoreWCF/Channels/HttpContextExtensions.cs#L18-L19
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.
The text was updated successfully, but these errors were encountered: