Commit 13c9ba0a authored by justcoding121's avatar justcoding121

cleanup

parent a5b2368d
......@@ -23,10 +23,9 @@ namespace Titanium.Web.Proxy.Extensions
{
await callback(sender, args);
}
catch (Exception ex)
catch (Exception e)
{
var ex2 = new Exception("Exception thrown in user event", ex);
exceptionFunc(ex2);
exceptionFunc(new Exception("Exception thrown in user event", e));
}
}
}
......
......@@ -660,21 +660,6 @@ namespace Titanium.Web.Proxy
endPoint.Listener.Server.Dispose();
}
private async Task InvokeBeforeRequest(SessionEventArgs args)
{
if (BeforeRequest != null)
{
await BeforeRequest.InvokeAsync(this, args, ExceptionFunc);
}
}
private async Task InvokeBeforeResponse(SessionEventArgs args)
{
if (BeforeResponse != null)
{
await BeforeResponse.InvokeAsync(this, args, ExceptionFunc);
}
}
internal void UpdateClientConnectionCount(bool increment)
{
......
......@@ -599,5 +599,13 @@ namespace Titanium.Web.Proxy
requestHeaders.FixProxyHeaders();
}
private async Task InvokeBeforeRequest(SessionEventArgs args)
{
if (BeforeRequest != null)
{
await BeforeRequest.InvokeAsync(this, args, ExceptionFunc);
}
}
}
}
......@@ -125,5 +125,14 @@ namespace Titanium.Web.Proxy
var compressor = CompressionFactory.GetCompression(encodingType);
return await compressor.Compress(responseBodyStream);
}
private async Task InvokeBeforeResponse(SessionEventArgs args)
{
if (BeforeResponse != null)
{
await BeforeResponse.InvokeAsync(this, args, ExceptionFunc);
}
}
}
}
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