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,18 +89,24 @@ namespace Titanium.Web.Proxy.Http
foreach (var headerItem in this.Request.RequestHeaders)
{
var header = headerItem.Value;
if (headerItem.Key != "Proxy-Authorization")
{
requestLines.AppendLine(header.Name + ':' + header.Value);
}
}
//write non unique request headers
foreach (var headerItem in this.Request.NonUniqueRequestHeaders)
{
var headers = headerItem.Value;
foreach (var header in headers)
{
if (headerItem.Key != "Proxy-Authorization")
{
requestLines.AppendLine(header.Name + ':' + header.Value);
}
}
}
requestLines.AppendLine();
......
......@@ -424,8 +424,11 @@ namespace Titanium.Web.Proxy
finally
{
if (tcpClient != null)
{
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