Transforming URLs

To transform URLs, the OnNetworkRequest

  1. Identify specific URLs using techniques such as regex or pattern matching.

    Note: This first step is optional because you can choose to transform the URLs of all network requests.
  2. Modify the URL property of theIHttpRequestTracker object.

  3. Assign a valid URL to the url property. Modifying other properties of the IHttpRequestTracker object will be ignored.

  4. Return true .

For example:

public static bool NetworkRequestCallback(IHttpRequestTracker tracker)
{
var maskUrl = new Uri("http://networkrequest-mask.com/");
tracker.Uri = maskUrl;
return true;
}

Transforming Sensitive URLs

You may want to identify and transform URLs that contain sensitive information.

For example:

public static bool NetworkRequestCallback(IHttpRequestTracker tracker)
{
var urlString = tracker.Uri.ToString();
if (urlString.Contains("accountInfo"))
{
tracker.Uri = new Uri("http://customer-account.com/");
}
return true;
}