public void RddTestHttpProcessingProfilerOnBeginSkipsAddingSourceHeaderPerConfig()
{
string hostnamepart = "partofhostname";
string url = string.Format(CultureInfo.InvariantCulture, "http://hostnamestart{0}hostnameend.com/path/to/something?param=1", hostnamepart);
var request = WebRequest.Create(new Uri(url));
Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());
var httpProcessingProfiler = new ProfilerHttpProcessing(this.configuration, null, new ObjectInstanceBasedOperationHolder(), /*setCorrelationHeaders*/ false, new List <string>(), RandomAppIdEndpoint);
httpProcessingProfiler.OnBeginForGetResponse(request);
Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());
ICollection <string> exclusionList = new SanitizedHostList()
{
"randomstringtoexclude", hostnamepart
};
httpProcessingProfiler = new ProfilerHttpProcessing(this.configuration, null, new ObjectInstanceBasedOperationHolder(), /*setCorrelationHeaders*/ true, exclusionList, RandomAppIdEndpoint);
httpProcessingProfiler.OnBeginForGetResponse(request);
Assert.IsNull(request.Headers[RequestResponseHeaders.RequestContextHeader]);
Assert.AreEqual(0, request.Headers.Keys.Cast <string>().Where((x) => { return(x.StartsWith("x-ms-", StringComparison.OrdinalIgnoreCase)); }).Count());
}