Commit 9ea77051 authored by Dave McDermid's avatar Dave McDermid

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
parent d91cc8b2
...@@ -115,8 +115,10 @@ namespace Titanium.Web.Proxy.Http ...@@ -115,8 +115,10 @@ namespace Titanium.Web.Proxy.Http
if (string.IsNullOrEmpty(httpResult[0])) if (string.IsNullOrEmpty(httpResult[0]))
{ {
await ServerConnection.StreamReader.ReadLineAsync(); //Empty content in first-line, try again
httpResult = (await ServerConnection.StreamReader.ReadLineAsync()).Split(ProxyConstants.SpaceSplit, 3);
} }
var httpVersion = httpResult[0].Trim().ToLower(); var httpVersion = httpResult[0].Trim().ToLower();
var version = new Version(1,1); var version = new Version(1,1);
......
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