/// <summary> /// Transform the partial redirect URL to a full one. /// </summary> /// <param name="har">The HAR.</param> private static void TransformPartialRedirectUrlToFull(Har har) { var responsesWithPartialRedirectUrl = har.Log.Entries .Where(e => e.Response.RedirectUrl != null && e.Response.RedirectUrl.OriginalString.StartsWith("/", StringComparison.OrdinalIgnoreCase)); foreach (var entry in responsesWithPartialRedirectUrl) { var requestUrl = entry.Request.Url; entry.Response.RedirectUrl = new Uri($"{requestUrl.GetLeftPart(UriPartial.Authority)}{entry.Response.RedirectUrl.AbsolutePath}"); } }
/// <summary> /// Transform the partial redirect URL to a full one. /// </summary> /// <param name="har">The HAR.</param> private static void TransformPartialRedirectUrlToFull(Har har) { var responsesWithPartialRedirectUrl = har.Log.Entries .Where(e => e.Response.RedirectUrl != null && e.Response.RedirectUrl.OriginalString.StartsWith("/", StringComparison.OrdinalIgnoreCase)); foreach (var entry in responsesWithPartialRedirectUrl) { var requestUrl = entry.Request.Url; entry.Response.RedirectUrl = new Uri("{0}{1}".With( requestUrl.GetLeftPart(UriPartial.Authority), entry.Response.RedirectUrl.AbsolutePath)); } }
public void LoadFromFile(string fileName) { m_har = HarConvert.DeserializeFromFile(fileName); initialize(); }