[Kestrel] Allow UTF-8 characters in request URL
See original GitHub issueWe want to support incoming UTF-8 characters in request URLs. We believe other servers support this, and need to do a little research to confirm that.
Today, URL characters must be in the range 0x00-0x7F
(excluding control chars). With this change, Kestrel would accept bytes over 0x7F
and expose them in the URL string as percent-encoded values. For example, consider
- Original requested URL:
/aéi
- As UTF-8 bytes:
0x2F 0x61 0xC3 0xA9 0x69
- IHttpRequestFeature.RawTarget would return:
/a%C3%A9i
- All other derived values, which normally decode percent-encoded raw URLs, would see the original intended value:
/aéi
To be clear: This behavior will be off-by-default and will be enabled via an option.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Kestrel: error if I use URL with non-ASCII characters
1 Answer 1 ... In general, any special characters should be urlencoded. That is the only safe way to include them in the...
Read more >ASP.NET Core 1.1 and ASP.NET Core 2.1 Not Supporting ...
If the application receives a request with a UTF-8 Non-ASCII character in the request header, it returns HTTP 400 "Invalid Request".
Read more >Charset Encoding in ASP.NET Response - Rick Strahl
So, I have a custom handler implementation - an Ajax CallbackHandler class - that returns Json and it too generates charset=utf-8. Now some ......
Read more >Azure is decoding characters in the URL before reaching ...
Does anyone know if there is a way to prevent Azure from decoding characters in the URL before it sends the request to...
Read more >Fun with URL Encodings | You've Been Haacked
Quick! How many ways are there with .NET Core to encode parts of a URL? Here's a list I came up with. HttpUtility.UrlEncode...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
And also it needs to be optional, with the default being off.
We haven’t gotten any requests for this feature so we’re not planning to work on it at this time. Will re-open this if there is more demand.