Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Version 2.7.0
- [Remove unused reference to System.Net.Http](https://github.com/microsoft/ApplicationInsights-aspnetcore/pull/879)

## Version 2.7.0-beta4
- [RequestTrackingTelemetryModule is modified to stop tracking exceptions by default, as exceptions are captured by ApplicationInsightsLoggerProvider.](https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/861)
- Updated Web/Base SDK version dependency to 2.10.0-beta4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using Extensibility.Implementation.Tracing;
using Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners.Implementation;
Expand Down Expand Up @@ -550,10 +549,11 @@ private void ReadCorrelationContext(IHeaderDictionary requestHeaders, Activity a
{
foreach (var item in baggage)
{
if (NameValueHeaderValue.TryParse(item, out var baggageItem))
var parts = item.Split('=');
if (parts.Length == 2)
{
var itemName = StringUtilities.EnforceMaxLength(baggageItem.Name, InjectionGuardConstants.ContextHeaderKeyMaxLength);
var itemValue = StringUtilities.EnforceMaxLength(baggageItem.Value, InjectionGuardConstants.ContextHeaderValueMaxLength);
var itemName = StringUtilities.EnforceMaxLength(parts[0], InjectionGuardConstants.ContextHeaderKeyMaxLength);
var itemValue = StringUtilities.EnforceMaxLength(parts[1], InjectionGuardConstants.ContextHeaderValueMaxLength);
activity.AddBaggage(itemName, itemValue);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ namespace Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners

internal static class HttpHeadersUtilities
{
internal static IEnumerable<string> GetHeaderValues(HttpHeaders headers, string headerName)
{
IEnumerable<string> result;
if (headers == null || !headers.TryGetValues(headerName, out result))
{
result = Enumerable.Empty<string>();
}
return result;
}

internal static IEnumerable<string> GetHeaderValues(IHeaderDictionary headers, string headerName)
{
IEnumerable<string> result = Enumerable.Empty<string>();
Expand All @@ -33,33 +23,17 @@ internal static IEnumerable<string> GetHeaderValues(IHeaderDictionary headers, s
return result;
}

internal static string GetHeaderKeyValue(HttpHeaders headers, string headerName, string keyName)
{
IEnumerable<string> headerValues = GetHeaderValues(headers, headerName);
return HeadersUtilities.GetHeaderKeyValue(headerValues, keyName);
}

internal static string GetHeaderKeyValue(IHeaderDictionary headers, string headerName, string keyName)
{
IEnumerable<string> headerValues = GetHeaderValues(headers, headerName);
return HeadersUtilities.GetHeaderKeyValue(headerValues, keyName);
}

internal static string GetRequestContextKeyValue(HttpHeaders headers, string keyName)
{
return GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName);
}

internal static string GetRequestContextKeyValue(IHeaderDictionary headers, string keyName)
{
return GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName);
}

internal static bool ContainsRequestContextKeyValue(HttpHeaders headers, string keyName)
{
return !string.IsNullOrEmpty(GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName));
}

internal static bool ContainsRequestContextKeyValue(IHeaderDictionary headers, string keyName)
{
return !string.IsNullOrEmpty(GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net46' ">
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down