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

Commit c2ade78

Browse files
Merge pull request #92 from davemcdermid/empty-response-first-line
Fix to handle empty first-line in HTTP Response
2 parents d91cc8b + 9ea7705 commit c2ade78

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)