-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kestrel] Support for custom decoder in headers #17400
Comments
Would it make sense to be more like: Encoding? GetEncodingForHeader(string headerName); ? I'm thinking that would enable:
Just a thought. Not sure if this has progressed since the original strawman. |
I think that does make more sense. I assume a null return value tells the server or client to use its default behavior. Do you think an interface for this belongs in System.Net.Http @stephentoub? |
Why would an interface be needed? It could just be a delegate? (But, yes, is there's a good reason for this to be an interface, we should have one rather than two. I just prefer a delegate for a single operation as a) it's faster, b) it's easier for a caller to supply, and c) it doesn't require introducing a new type.) |
That's my suggestion, as would not providing a delegate/interface at all. |
It's not, and it could be. I was thinking about having custom decoders be registered via DI, but I understand this doesn't make sense for System.Net. |
Follow up from #17399
In 5.0 we want to provide a hook to use a custom decoder for headers. A
System.Text.Encoding.Encoder
is probably not quite sufficient since the codec may want to see the header name in order to make decisions. A strawman API would be something like this:The text was updated successfully, but these errors were encountered: