Commit e1cd5fcd authored by justcoding121's avatar justcoding121

minor fixes

parent 4e164ebd
......@@ -68,7 +68,7 @@ namespace Titanium.Web.Proxy.Network
x.IsSecure == isSecure && x.TcpClient.Connected && x.Version.Equals(version)).Count() < 2)
{
var task = CreateClient(sessionArgs, hostname, port, isSecure, version)
.ContinueWith(x => ReleaseClient(x.Result));
.ContinueWith(x => { if (x.Status == TaskStatus.RanToCompletion) ReleaseClient(x.Result); });
}
return cached;
......
......@@ -67,8 +67,10 @@ namespace Titanium.Web.Proxy
{
args.WebSession.Response.ResponseBody = await GetCompressedResponseBody(contentEncoding, args.WebSession.Response.ResponseBody).ConfigureAwait(false);
if (isChunked==false)
if (isChunked == false)
args.WebSession.Response.ContentLength = args.WebSession.Response.ResponseBody.Length;
else
args.WebSession.Response.ContentLength = -1;
}
await WriteResponseHeaders(args.Client.ClientStreamWriter, args.WebSession.Response.ResponseHeaders).ConfigureAwait(false);
......
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