Commit 79a4df93 authored by ilushka85's avatar ilushka85

Do not send proxy-authorization header upstream to webserver. Try to fix...

Do not send proxy-authorization header upstream to webserver.  Try to fix object disposed execption that occurs here.
parent ecd567de
......@@ -89,7 +89,10 @@ namespace Titanium.Web.Proxy.Http
foreach (var headerItem in this.Request.RequestHeaders)
{
var header = headerItem.Value;
requestLines.AppendLine(header.Name + ':' + header.Value);
if (headerItem.Key != "Proxy-Authorization")
{
requestLines.AppendLine(header.Name + ':' + header.Value);
}
}
//write non unique request headers
......@@ -98,7 +101,10 @@ namespace Titanium.Web.Proxy.Http
var headers = headerItem.Value;
foreach (var header in headers)
{
requestLines.AppendLine(header.Name + ':' + header.Value);
if (headerItem.Key != "Proxy-Authorization")
{
requestLines.AppendLine(header.Name + ':' + header.Value);
}
}
}
......
......@@ -425,7 +425,10 @@ namespace Titanium.Web.Proxy
{
if (tcpClient != null)
{
tcpClient.LingerState = new LingerOption(true, 0);
if (tcpClient.LingerState != null)
{
tcpClient.LingerState = new LingerOption(true, 0);
}
tcpClient.Client.Shutdown(SocketShutdown.Both);
tcpClient.Client.Close();
tcpClient.Client.Dispose();
......
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