@@ -232,20 +232,6 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
232
232
args . Client . ClientStreamReader = clientStreamReader ;
233
233
args . Client . ClientStreamWriter = clientStreamWriter ;
234
234
235
- //If requested interception
236
- if ( BeforeRequest != null )
237
- {
238
- BeforeRequest ( null , args ) ;
239
- }
240
-
241
- args . ProxySession . Request . RequestLocked = true ;
242
-
243
- if ( args . ProxySession . Request . CancelRequest )
244
- {
245
- Dispose ( client , clientStream , clientStreamReader , clientStreamWriter , args ) ;
246
- break ;
247
- }
248
-
249
235
if ( args . ProxySession . Request . UpgradeToWebSocket )
250
236
{
251
237
TcpHelper . SendRaw ( clientStream , httpCmd , args . ProxySession . Request . RequestHeaders ,
@@ -266,7 +252,7 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
266
252
args . ProxySession . SetConnection ( connection ) ;
267
253
args . ProxySession . SendRequest ( ) ;
268
254
269
- if ( Enable100ContinueBehaviour )
255
+ if ( Enable100ContinueBehaviour )
270
256
if ( args . ProxySession . Request . Is100Continue )
271
257
{
272
258
WriteResponseStatus ( args . ProxySession . Response . HttpVersion , "100" ,
@@ -281,6 +267,21 @@ private static void HandleHttpSessionRequest(TcpClient client, string httpCmd, S
281
267
}
282
268
283
269
270
+ //If requested interception
271
+ if ( BeforeRequest != null )
272
+ {
273
+ BeforeRequest ( null , args ) ;
274
+ }
275
+
276
+ args . ProxySession . Request . RequestLocked = true ;
277
+
278
+ if ( args . ProxySession . Request . CancelRequest )
279
+ {
280
+ Dispose ( client , clientStream , clientStreamReader , clientStreamWriter , args ) ;
281
+ break ;
282
+ }
283
+
284
+
284
285
//If request was modified by user
285
286
if ( args . ProxySession . Request . RequestBodyRead )
286
287
{
0 commit comments