Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 2b9a7d3

Browse files
committed
Merge branch 'develop' of https://github.com/justcoding121/Titanium-Web-Proxy into develop
2 parents 2543b9c + 13c9ba0 commit 2b9a7d3

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

Titanium.Web.Proxy/Extensions/FuncExtensions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ private static async Task InternalInvokeAsync<T>(AsyncEventHandler<T> callback,
2323
{
2424
await callback(sender, args);
2525
}
26-
catch (Exception ex)
26+
catch (Exception e)
2727
{
28-
var ex2 = new Exception("Exception thrown in user event", ex);
29-
exceptionFunc(ex2);
28+
exceptionFunc(new Exception("Exception thrown in user event", e));
3029
}
3130
}
3231
}

Titanium.Web.Proxy/ProxyServer.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -660,21 +660,6 @@ private void QuitListen(ProxyEndPoint endPoint)
660660
endPoint.Listener.Server.Dispose();
661661
}
662662

663-
private async Task InvokeBeforeRequest(SessionEventArgs args)
664-
{
665-
if (BeforeRequest != null)
666-
{
667-
await BeforeRequest.InvokeAsync(this, args, ExceptionFunc);
668-
}
669-
}
670-
671-
private async Task InvokeBeforeResponse(SessionEventArgs args)
672-
{
673-
if (BeforeResponse != null)
674-
{
675-
await BeforeResponse.InvokeAsync(this, args, ExceptionFunc);
676-
}
677-
}
678663

679664
internal void UpdateClientConnectionCount(bool increment)
680665
{

Titanium.Web.Proxy/RequestHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,5 +599,13 @@ private void PrepareRequestHeaders(HeaderCollection requestHeaders)
599599

600600
requestHeaders.FixProxyHeaders();
601601
}
602+
603+
private async Task InvokeBeforeRequest(SessionEventArgs args)
604+
{
605+
if (BeforeRequest != null)
606+
{
607+
await BeforeRequest.InvokeAsync(this, args, ExceptionFunc);
608+
}
609+
}
602610
}
603611
}

Titanium.Web.Proxy/ResponseHandler.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,14 @@ private async Task<byte[]> GetCompressedResponseBody(string encodingType, byte[]
125125
var compressor = CompressionFactory.GetCompression(encodingType);
126126
return await compressor.Compress(responseBodyStream);
127127
}
128+
129+
130+
private async Task InvokeBeforeResponse(SessionEventArgs args)
131+
{
132+
if (BeforeResponse != null)
133+
{
134+
await BeforeResponse.InvokeAsync(this, args, ExceptionFunc);
135+
}
136+
}
128137
}
129138
}

0 commit comments

Comments
 (0)