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

Fixing response status line parsing #482

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Titanium.Web.Proxy/Http/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal static void ParseResponseLine(string httpStatus, out Version version, o
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);
}
Expand All @@ -159,7 +159,7 @@ internal static void ParseResponseLine(string httpStatus, out Version version, o
}

statusCode = int.Parse(httpResult[1]);
statusDescription = httpResult[2];
statusDescription = httpResult.Length > 2 ? httpResult[2] : string.Empty;
}
}
}