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

Commit

Permalink
move user callback after 100 continue test
Browse files Browse the repository at this point in the history
  • Loading branch information
justcoding121 committed Apr 19, 2016
1 parent 9c08874 commit 5303951
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions Titanium.Web.Proxy/RequestHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,6 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
args.Client.ClientStreamReader = clientStreamReader;
args.Client.ClientStreamWriter = clientStreamWriter;

//If requested interception
if (BeforeRequest != null)
{
BeforeRequest(null, args);
}

args.ProxySession.Request.RequestLocked = true;

if (args.ProxySession.Request.CancelRequest)
{
Dispose(client, clientStream, clientStreamReader, clientStreamWriter, args);
break;
}

if (args.ProxySession.Request.UpgradeToWebSocket)
{
TcpHelper.SendRaw(clientStream, httpCmd, args.ProxySession.Request.RequestHeaders,
Expand All @@ -266,7 +252,7 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
args.ProxySession.SetConnection(connection);
args.ProxySession.SendRequest();

if(Enable100ContinueBehaviour)
if (Enable100ContinueBehaviour)
if (args.ProxySession.Request.Is100Continue)
{
WriteResponseStatus(args.ProxySession.Response.HttpVersion, "100",
Expand All @@ -281,6 +267,21 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
}


//If requested interception
if (BeforeRequest != null)
{
BeforeRequest(null, args);
}

args.ProxySession.Request.RequestLocked = true;

if (args.ProxySession.Request.CancelRequest)
{
Dispose(client, clientStream, clientStreamReader, clientStreamWriter, args);
break;
}


//If request was modified by user
if (args.ProxySession.Request.RequestBodyRead)
{
Expand Down

0 comments on commit 5303951

Please sign in to comment.