Commit 5820d484 authored by ilushka85's avatar ilushka85

pass ConnectHeaders

parent 383ec0a4
......@@ -56,6 +56,9 @@ namespace Titanium.Web.Proxy.EventArguments
public ExternalProxy CustomUpStreamHttpsProxyUsed { get; set; }
/// <summary>
/// Constructor to initialize the proxy
/// </summary>
......
......@@ -19,6 +19,8 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
internal TcpConnection ServerConnection { get; set; }
public List<HttpHeader> ConnectHeaders { get; set; }
public Request Request { get; set; }
public Response Response { get; set; }
......
......@@ -294,7 +294,7 @@ namespace Titanium.Web.Proxy
//Now create the request
await HandleHttpSessionRequest(tcpClient, httpCmd, clientStream, clientStreamReader, clientStreamWriter,
endPoint.EnableSsl ? endPoint.GenericCertificateName : null,null);
endPoint.EnableSsl ? endPoint.GenericCertificateName : null, null);
}
/// <summary>
/// This is the core request handler method for a particular connection from client
......@@ -442,10 +442,7 @@ namespace Titanium.Web.Proxy
{
if (GetCustomUpStreamHttpsProxyFunc != null)
{
foreach (var header in args.WebSession.Request.RequestHeaders.Values)
{
connectHeaders.Add(header);
}
args.WebSession.ConnectHeaders = connectHeaders;
customUpStreamHttpsProxy = await GetCustomUpStreamHttpsProxyFunc(args).ConfigureAwait(false);
}
}
......@@ -462,7 +459,7 @@ namespace Titanium.Web.Proxy
}
else
{
if(connection.IsHttps)
if (connection.IsHttps)
{
args.CustomUpStreamHttpsProxyUsed = connection.UpStreamHttpsProxy;
......
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