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

Commit 9ea7705

Browse files
author
Dave McDermid
committed
Fix to handle empty first-line in HTTP Response
- When the first line read in the HTTP response is empty, read the next line into httpResult. - Fixes bug where next line was read but httpResult was not updated
1 parent d91cc8b commit 9ea7705

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Titanium.Web.Proxy/Http/HttpWebClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ internal async Task ReceiveResponse()
115115

116116
if (string.IsNullOrEmpty(httpResult[0]))
117117
{
118-
await ServerConnection.StreamReader.ReadLineAsync();
118+
//Empty content in first-line, try again
119+
httpResult = (await ServerConnection.StreamReader.ReadLineAsync()).Split(ProxyConstants.SpaceSplit, 3);
119120
}
121+
120122
var httpVersion = httpResult[0].Trim().ToLower();
121123

122124
var version = new Version(1,1);

0 commit comments

Comments
 (0)