Commit f700630f authored by Anton Ryzhov's avatar Anton Ryzhov

Fixing response status line parsing, so that status line is parsed correctly...

Fixing response status line parsing, so that status line is parsed correctly even if Reason-Phrase is missing
parent 042a3a06
......@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Http
out string statusDescription)
{
var httpResult = httpStatus.Split(ProxyConstants.SpaceSplit, 3);
if (httpResult.Length != 3)
if (httpResult.Length <= 1)
{
throw new Exception("Invalid HTTP status line: " + httpStatus);
}
......@@ -159,7 +159,7 @@ namespace Titanium.Web.Proxy.Http
}
statusCode = int.Parse(httpResult[1]);
statusDescription = httpResult[2];
statusDescription = httpResult.Length > 2 ? httpResult[2] : string.Empty;
}
}
}
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