Commit a8ceb68b authored by titanium007's avatar titanium007

lock host set

parent 65d6e3ef
...@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.Network ...@@ -20,7 +20,7 @@ namespace Titanium.Web.Proxy.Network
public Uri RequestUri { get; set; } public Uri RequestUri { get; set; }
public string HttpVersion { get; set; } public string HttpVersion { get; set; }
public string Host internal string Host
{ {
get get
{ {
......
...@@ -237,7 +237,6 @@ namespace Titanium.Web.Proxy ...@@ -237,7 +237,6 @@ namespace Titanium.Web.Proxy
args.Client.ClientStream = clientStream; args.Client.ClientStream = clientStream;
args.Client.ClientStreamReader = clientStreamReader; args.Client.ClientStreamReader = clientStreamReader;
args.Client.ClientStreamWriter = clientStreamWriter; args.Client.ClientStreamWriter = clientStreamWriter;
args.ProxySession.Request.Host = args.ProxySession.Request.RequestUri.Host;
//If requested interception //If requested interception
if (BeforeRequest != null) if (BeforeRequest != null)
...@@ -257,11 +256,11 @@ namespace Titanium.Web.Proxy ...@@ -257,11 +256,11 @@ namespace Titanium.Web.Proxy
//construct the web request that we are going to issue on behalf of the client. //construct the web request that we are going to issue on behalf of the client.
connection = connection == null ? connection = connection == null ?
TcpConnectionManager.GetClient(args.ProxySession.Request.RequestUri.Host, args.ProxySession.Request.RequestUri.Port, args.IsHttps) TcpConnectionManager.GetClient(args.ProxySession.Request.RequestUri.Host, args.ProxySession.Request.RequestUri.Port, args.IsHttps)
: lastRequestHostName != args.ProxySession.Request.Host ? TcpConnectionManager.GetClient(args.ProxySession.Request.RequestUri.Host, args.ProxySession.Request.RequestUri.Port, args.IsHttps) : lastRequestHostName != args.ProxySession.Request.RequestUri.Host ? TcpConnectionManager.GetClient(args.ProxySession.Request.RequestUri.Host, args.ProxySession.Request.RequestUri.Port, args.IsHttps)
: connection; : connection;
lastRequestHostName = args.ProxySession.Request.Host; lastRequestHostName = args.ProxySession.Request.RequestUri.Host;
args.ProxySession.Request.Host = args.ProxySession.Request.RequestUri.Host;
args.ProxySession.SetConnection(connection); args.ProxySession.SetConnection(connection);
args.ProxySession.SendRequest(); args.ProxySession.SendRequest();
......
...@@ -84,8 +84,6 @@ namespace Titanium.Web.Proxy ...@@ -84,8 +84,6 @@ namespace Titanium.Web.Proxy
} }
private static void WriteResponseStatus(string version, string code, string description, private static void WriteResponseStatus(string version, string code, string description,
StreamWriter responseWriter) StreamWriter responseWriter)
{ {
......
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