Open dimansound opened 2 years ago
Do you change the url (or the query string ) in TWP? I tried to repducuce the issue, but can't ... however I did not change anything in TWP chrome => TWP => Fiddler => server works:
Browser:
Upstream Http proxy (Fiddler):
So please specify what did you do in your application.
Do you change the url (or the query string ) in TWP?
I changed code url = Request.RequestUri.ToString() to url = Request.RequestUriString; Request.RequestUri.ToString() got ?systemCode=附件系统 Request.RequestUriString got ?systemCode=%E9%99%84%E4%BB%B6%E7%B3%BB%E7%BB%9F Otherwise, this is what happens: In original code TWP v3.2 in HttpWebClient.cs used this method (condition when useUpstreamProxy = true) url = Request.RequestUri.ToString(); So this method returned not urlencoded value of url http://.../?systemCode=附件系统 Next step in method headerBuilder.WriteRequestLine(Request.Method, url, Request.HttpVersion);
As a result, due to the fact that Request.RequestUri.ToString() returns an unencoded value, when encoding, the result is encoding.GetBytes(str) = "????", that is, instead of Chinese characters, since ISO-8859-1 is used, Chinese characters are encoded as the character "?"
Broken url parameter comes to upstream proxy when use UpStreamHttpProxy and Chinese characters in url params, for example any url with this params:
&systemCode=附件系统 or &systemCode=%E9%99%84%E4%BB%B6%E7%B3%BB%E7%BB%9F
On the upstream proxy got &systemCode=???? BeforeRequest by default, hasn't code. Without UpStreamHttpProxy works well done. Titanium version 3.1.1450