Unverified Commit 41680e7f authored by justcoding121's avatar justcoding121 Committed by GitHub

Merge pull request #482 from antrv/feature/status-description

Fixing response status line parsing
parents 0478f21e f700630f
...@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -145,7 +145,7 @@ namespace Titanium.Web.Proxy.Http
out string statusDescription) out string statusDescription)
{ {
var httpResult = httpStatus.Split(ProxyConstants.SpaceSplit, 3); var httpResult = httpStatus.Split(ProxyConstants.SpaceSplit, 3);
if (httpResult.Length != 3) if (httpResult.Length <= 1)
{ {
throw new Exception("Invalid HTTP status line: " + httpStatus); throw new Exception("Invalid HTTP status line: " + httpStatus);
} }
...@@ -159,7 +159,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -159,7 +159,7 @@ namespace Titanium.Web.Proxy.Http
} }
statusCode = int.Parse(httpResult[1]); 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