Skip to content

Instantly share code, notes, and snippets.

@debugthings
Created August 15, 2017 20:32
Show Gist options
  • Select an option

  • Save debugthings/c536912a3d0044103043d7a84c8e24c1 to your computer and use it in GitHub Desktop.

Select an option

Save debugthings/c536912a3d0044103043d7a84c8e24c1 to your computer and use it in GitHub Desktop.
using Microsoft.VisualStudio.TestTools.WebTesting;
using System.ComponentModel;
namespace CustomPlugin
{
[DisplayName("Replace Encoded Slash")]
[Description("Replaces %2F with %252F to avoid the doubleslash (//) escape.")]
public class FixFilter : WebTestRequestPlugin
{
public FixFilter() { }
public override void PostRequest(object sender, PostRequestEventArgs e)
{
if (e.Request.HasDependentRequests)
{
foreach (var item in e.Request.DependentRequests)
{
item.Url = item.Url.Replace("%2F", "%252F");
}
}
base.PostRequest(sender, e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment