Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCS committed May 28, 2024
1 parent c4ef94e commit 2ece53e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tool/SystemTestingTools/Internal/RecordingFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static bool IsValid(string content)
// part 1 = date time of the recording
// part 2 = request details
// part 3 = response details
private static Regex RecordingRegex = new Regex(@".+?\nDate:(.+?)\n.+?REQUEST.+?\n(.+?)--\!\?@Divider:.+?\n(.*)", RegexOptions.Compiled | RegexOptions.Singleline);
private static Regex RecordingRegex = new Regex(@".+?\nDate:(.+?)\n.+?REQUEST.*?\n(.+?)--\!\?@Divider:.+?\n(.*)", RegexOptions.Compiled | RegexOptions.Singleline);

private static Regex DateRegex = new Regex(@"(2.+?)\(", RegexOptions.Compiled | RegexOptions.Singleline);

Expand Down Expand Up @@ -183,7 +183,7 @@ public static Recording Read(string content)
private static Regex RequestRegex = new Regex(@"^(.+?) (.+?)\n(.+?)(\r\r|\n\n|\r\n\r\n)(.*)", RegexOptions.Compiled | RegexOptions.Singleline);
private static HttpRequestMessage GetRequest(string requestContent)
{
var match = RequestRegex.Match(requestContent.TrimStart());
var match = RequestRegex.Match(requestContent);

if (!match.Success) throw new ApplicationException($"Could not parse request data");

Expand All @@ -196,7 +196,7 @@ private static HttpRequestMessage GetRequest(string requestContent)
}
catch (System.FormatException ex)
{
throw new Exception($"Method [{method}] is invalid, {requestContent}", ex);
throw new Exception($"Method [{method}] is invalid", ex);
}

result.RequestUri = new Uri(match.Groups[2].Value);
Expand Down

0 comments on commit 2ece53e

Please sign in to comment.