Commit 74ebc38f authored by justcoding121's avatar justcoding121

cleanup header writer

parent 2f96a6a4
......@@ -107,7 +107,7 @@ namespace Titanium.Web.Proxy.Helpers
var headerBuilder = new StringBuilder();
foreach (var header in headers)
{
header.Write(headerBuilder);
headerBuilder.AppendLine(header.ToString());
}
headerBuilder.AppendLine();
......
......@@ -103,9 +103,8 @@ namespace Titanium.Web.Proxy.Http
&& !string.IsNullOrEmpty(upstreamProxy.UserName)
&& upstreamProxy.Password != null)
{
HttpHeader.ProxyConnectionKeepAlive.Write(headerBuilder);
HttpHeader.GetProxyAuthorizationHeader(upstreamProxy.UserName, upstreamProxy.Password)
.Write(headerBuilder);
headerBuilder.AppendLine(HttpHeader.ProxyConnectionKeepAlive.ToString());
headerBuilder.AppendLine(HttpHeader.GetProxyAuthorizationHeader(upstreamProxy.UserName, upstreamProxy.Password).ToString());
}
// write request headers
......@@ -113,7 +112,7 @@ namespace Titanium.Web.Proxy.Http
{
if (isTransparent || header.Name != KnownHeaders.ProxyAuthorization)
{
header.Write(headerBuilder);
headerBuilder.AppendLine(header.ToString());
}
}
......
......@@ -60,10 +60,5 @@ namespace Titanium.Web.Proxy.Models
"Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes($"{userName}:{password}")));
return result;
}
internal void Write(StringBuilder writer)
{
writer.AppendLine($"{Name}: {Value}");
}
}
}
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