Commit 3940b26d authored by Honfika's avatar Honfika

do not unescape non well formatted original uris

parent 9fa725d7
......@@ -97,10 +97,19 @@ namespace Titanium.Web.Proxy.Http
var writer = Connection.StreamWriter;
string url;
if (useUpstreamProxy || isTransparent)
{
url = Request.RequestUriString;
}
else
{
var uri = Request.RequestUri;
url = uri.IsWellFormedOriginalString() ? uri.PathAndQuery : uri.GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
}
// prepare the request & headers
await writer.WriteLineAsync(Request.CreateRequestLine(Request.Method,
useUpstreamProxy || isTransparent ? Request.RequestUriString : Request.RequestUri.PathAndQuery,
Request.HttpVersion), cancellationToken);
await writer.WriteLineAsync(Request.CreateRequestLine(Request.Method, url, Request.HttpVersion), cancellationToken);
var headerBuilder = new StringBuilder();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment