Commit 5303951b authored by justcoding121's avatar justcoding121

move user callback after 100 continue test

parent 9c08874b
...@@ -232,20 +232,6 @@ namespace Titanium.Web.Proxy ...@@ -232,20 +232,6 @@ namespace Titanium.Web.Proxy
args.Client.ClientStreamReader = clientStreamReader; args.Client.ClientStreamReader = clientStreamReader;
args.Client.ClientStreamWriter = clientStreamWriter; 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) if (args.ProxySession.Request.UpgradeToWebSocket)
{ {
TcpHelper.SendRaw(clientStream, httpCmd, args.ProxySession.Request.RequestHeaders, TcpHelper.SendRaw(clientStream, httpCmd, args.ProxySession.Request.RequestHeaders,
...@@ -266,7 +252,7 @@ namespace Titanium.Web.Proxy ...@@ -266,7 +252,7 @@ namespace Titanium.Web.Proxy
args.ProxySession.SetConnection(connection); args.ProxySession.SetConnection(connection);
args.ProxySession.SendRequest(); args.ProxySession.SendRequest();
if(Enable100ContinueBehaviour) if (Enable100ContinueBehaviour)
if (args.ProxySession.Request.Is100Continue) if (args.ProxySession.Request.Is100Continue)
{ {
WriteResponseStatus(args.ProxySession.Response.HttpVersion, "100", WriteResponseStatus(args.ProxySession.Response.HttpVersion, "100",
...@@ -281,6 +267,21 @@ namespace Titanium.Web.Proxy ...@@ -281,6 +267,21 @@ namespace Titanium.Web.Proxy
} }
//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 request was modified by user
if (args.ProxySession.Request.RequestBodyRead) if (args.ProxySession.Request.RequestBodyRead)
{ {
......
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