Closed
Description
We have customers interested in treating incoming request headers as Latin1-encoded but our default logic only supports UTF-8.
In a 3.1 patch we should provide:
- A config setting to change the default encoding to Latin1
- When enabled, Kestrel will widen each incoming byte to a UTF-16 character and build a
string
from that set of characters, instead of interpreting bytes as UTF-8. - We will continue to reject control characters from the ASCII set (0x00-0x1F and 0x7F), but not reject control characters from the widened Latin1 set (because they would collide with other interpretations of this data, like UTF-8).
This would allow a consumer to reinterpret the data in this string as a UTF-8 sequence if desired.
In 5.0 we'll look at broader work to improve this experience. The 3.1 goals are scoped down to specific requests we've received.