Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #55 from justcoding121/master
Browse files Browse the repository at this point in the history
lock host set
  • Loading branch information
justcoding121 committed Mar 22, 2016
2 parents c625408 + a8ceb68 commit ab92537
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Titanium.Web.Proxy/Network/HttpWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Request
public Uri RequestUri { get; set; }
public string HttpVersion { get; set; }

public string Host
internal string Host
{
get
{
Expand Down
7 changes: 3 additions & 4 deletions Titanium.Web.Proxy/RequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
args.Client.ClientStream = clientStream;
args.Client.ClientStreamReader = clientStreamReader;
args.Client.ClientStreamWriter = clientStreamWriter;
args.ProxySession.Request.Host = args.ProxySession.Request.RequestUri.Host;

//If requested interception
if (BeforeRequest != null)
Expand All @@ -257,11 +256,11 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
//construct the web request that we are going to issue on behalf of the client.
connection = connection == null ?
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;

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.SendRequest();

Expand Down
2 changes: 0 additions & 2 deletions Titanium.Web.Proxy/ResponseHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public static void HandleHttpSessionResponse(SessionEventArgs args)
}




private static void WriteResponseStatus(string version, string code, string description,
StreamWriter responseWriter)
{
Expand Down

0 comments on commit ab92537

Please sign in to comment.