Recently, ISO APIs have been developed, and web API self host is used as the server. for iOS requests, asihttprequest is used for http get requests. Once a request is sent, an error occurs on the server and cannot be captured using filter.
After debugging, it was found that the User-Agent in the HTTP request header was running, and its value was actually a bunch of strange characters: "commandid § ç ?? 1.0 iPod Touch; iPhone OS 5.0.1; ZH-CN ";
After the Custom User-Agent is a pure English character,ProgramIf the HTTP header contains unencoded Chinese characters, an exception is thrown when the web API is running.
Currently, there is no solution for capturing this exception on the server. Which of the following experts knows how to handle the exception and ask for help?
========================================================== ==========================================
Latest discoveries
I posted a help post on the official Asp.net Forum. After some interaction, I found that this bug could not be reproduced in the English operating system.
So after I modify the "non-Unicode program language" of the operating system locally to English, the program will not crash, indicating that this problem is related to encoding.
No other solutions available currently
========================================================== ============
It is determined to be an RC bug. You can refer to my post on the official Asp.net forum.
Self Host application running on non-Unicode OS can be easily broken by sending a header value with invalid character