|
1 | | -using System; |
| 1 | +using Microsoft.AspNetCore.Http; |
| 2 | +using Microsoft.Extensions.Logging; |
| 3 | +using Microsoft.Extensions.Logging.Abstractions; |
| 4 | +using Microsoft.Extensions.Primitives; |
| 5 | + |
| 6 | +using System; |
2 | 7 | using System.Collections.Generic; |
3 | 8 | using System.Collections.ObjectModel; |
4 | 9 | using System.IO; |
5 | 10 | using System.Linq; |
6 | 11 | using System.Net; |
7 | 12 | using System.Threading.Tasks; |
8 | | -using Microsoft.AspNetCore.Http; |
9 | | -using Microsoft.Extensions.Logging; |
10 | | -using Microsoft.Extensions.Logging.Abstractions; |
11 | | -using Microsoft.Extensions.Primitives; |
12 | 13 |
|
13 | 14 | namespace Arcus.WebApi.Logging.Core.RequestTracking |
14 | 15 | { |
@@ -78,7 +79,7 @@ protected bool AllowedToTrackStatusCode(int responseStatusCode, IEnumerable<Stat |
78 | 79 |
|
79 | 80 | StatusCodeRange[] combinedStatusCodeRanges = |
80 | 81 | optionsTrackedStatusCodes |
81 | | - .Select(code => new StatusCodeRange((int) code)) |
| 82 | + .Select(code => new StatusCodeRange((int)code)) |
82 | 83 | .Concat(attributeTrackedStatusCodes ?? Enumerable.Empty<StatusCodeRange>()) |
83 | 84 | .Concat(optionsTrackedStatusCodeRanges) |
84 | 85 | .Where(range => range != null) |
@@ -116,7 +117,7 @@ protected Dictionary<string, object> CreateTelemetryContext(string requestBody, |
116 | 117 | try |
117 | 118 | { |
118 | 119 | IDictionary<string, StringValues> headers = GetSanitizedRequestHeaders(requestHeaders, logger); |
119 | | - Dictionary<string, string> telemetryContext = headers.ToDictionary(header => header.Key, header => string.Join(",", header.Value)); |
| 120 | + Dictionary<string, string> telemetryContext = headers.ToDictionary(header => header.Key, header => string.Join(",", header.Value.ToString())); |
120 | 121 |
|
121 | 122 | if (!string.IsNullOrWhiteSpace(requestBody)) |
122 | 123 | { |
|
0 commit comments