@@ -55,7 +55,7 @@ private static async void HandleClient(ExplicitProxyEndPoint endPoint, TcpClient
55
55
Version version = new Version ( 1 , 1 ) ;
56
56
if ( httpCmdSplit . Length == 3 )
57
57
{
58
- string httpVersion = httpCmdSplit [ 1 ] . Trim ( ) ;
58
+ string httpVersion = httpCmdSplit [ 2 ] . Trim ( ) ;
59
59
60
60
if ( httpVersion == "http/1.0" )
61
61
{
@@ -204,24 +204,24 @@ private static async Task HandleHttpSessionRequest(TcpClient client, string http
204
204
var httpCmdSplit = httpCmd . Split ( Constants . SpaceSplit , 3 ) ;
205
205
206
206
var httpMethod = httpCmdSplit [ 0 ] ;
207
- var httpVersion = httpCmdSplit [ 2 ] . ToLower ( ) . Trim ( ) ;
208
207
209
- Version version ;
210
- if ( httpVersion == "http/1.1" )
208
+ Version version = new Version ( 1 , 1 ) ;
209
+ if ( httpCmdSplit . Length == 3 )
211
210
{
212
- version = new Version ( 1 , 1 ) ;
213
- }
214
- else
215
- {
216
- version = new Version ( 1 , 0 ) ;
211
+ var httpVersion = httpCmdSplit [ 2 ] . ToLower ( ) . Trim ( ) ;
212
+
213
+ if ( httpVersion == "http/1.0" )
214
+ {
215
+ version = new Version ( 1 , 0 ) ;
216
+ }
217
217
}
218
218
219
219
args . WebSession . Request . RequestHeaders = new List < HttpHeader > ( ) ;
220
220
221
221
string tmpLine ;
222
222
while ( ! string . IsNullOrEmpty ( tmpLine = await clientStreamReader . ReadLineAsync ( ) . ConfigureAwait ( false ) ) )
223
223
{
224
- var header = tmpLine . Split ( new char [ ] { ':' } , 2 ) ;
224
+ var header = tmpLine . Split ( Constants . ColonSplit , 2 ) ;
225
225
args . WebSession . Request . RequestHeaders . Add ( new HttpHeader ( header [ 0 ] , header [ 1 ] ) ) ;
226
226
}
227
227
0 commit comments