[Breaking Change]: HttpTelemetry Redacts Query Strings by Default
Description:
In .NET 9, the default behavior of HttpTelemetry (EventSource "System.Net.Http") has been modified to redact query strings. This change is aimed at enhancing security by preventing the logging of potentially sensitive information contained in query strings. The same opt-out mechanism used for distributed tracing (Activity) and HttpClientFactory logging is applied here. For scenarios where logging query strings is necessary and deemed safe, this behavior can be overridden by enabling the System.Net.Http.DisableUriRedaction AppContext switch or by setting the DOTNET_SYSTEM_NET_HTTP_DISABLEURIREDACTION environment variable.
Previous Behavior:
Previously, HttpTelemetry logs included query strings by default, which could inadvertently expose sensitive information.
New Behavior:
With the new change, query strings are redacted from HttpTelemetry logs by default. Developers can enable query string logging global
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.5.6+bf9b858c26 (64-bit .NET 8.0.26) | |
| [xUnit.net 00:00:00.09] Discovering: SixLabors.ImageSharp.Tests (method display = Method, method display options = None) | |
| [xUnit.net 00:00:02.23] Discovered: SixLabors.ImageSharp.Tests (found 1452 test cases) | |
| [xUnit.net 00:00:02.23] Starting: SixLabors.ImageSharp.Tests (parallel test collections = on [16 threads], stop on fail = off) | |
| [xUnit.net 00:00:11.59] CreateRegion_NestedRegionsAndStateIsolation_MatchesDefaultOutput<Rgba32>(provider: Solid320x220_(255,255,255,255)[Rgba32]) [FAIL] | |
| [xUnit.net 00:00:11.59] SixLabors.ImageSharp.Drawing.Tests.TestUtilities.ImageComparison.ImageDifferenceIsOverThresholdException : Image difference is over threshold! | |
| [xUnit.net 00:00:11.59] Report ImageFrame 0: | |
| [xUnit.net 00:00:11.59] Total difference: 0.0004% | |
| [xUnit.net 00:00:11.59] [Δ(-257,-257,-257,0) @ (300,20)]; | |
| [xUnit.net 00:00:11.59] [Δ(0,-257,0,0) @ (57,26)]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> | |
| <body> | |
| <h1>Test run details</h1> | |
| <div class="summary"> | |
| <div class="block"><span>Total tests</span><div class="total-tests">1452</div><br></div> | |
| <div class="block"><span>Passed : </span><span class="passedTests">1424</span><br><span>Failed : </span><span class="failedTests">19</span><br><span>Skipped : </span><span class="skippedTests">9</span><br></div> | |
| <div class="block"><span>Pass percentage</span><div class="pass-percentage">98 %</div><br></div> | |
| <div class="block"><span>Run duration</span><div class="test-run-time">20s 765ms</div><br></div><br></div> | |
| <h2>Failed Results</h2><details open=""><summary>C:\dev\ImageSharp.Drawing\artifacts\bin\tests\ImageSharp.Drawing.Tests\Release\net8.0\SixLabors.ImageSharp.Tests.dll</summary><div cla |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static Image LoadPreservePixelType(string path) | |
| { | |
| var info = Image.Identify(path); | |
| var format = info.Metadata.DecodedImageFormat; | |
| // PNG: PngColorType fully describes the pixel layout including alpha | |
| if (format is PngFormat) return LoadPng(path, info); | |
| // BMP, TGA: native channel order is BGR/BGRA | |
| if (format is BmpFormat) return LoadBmp(path, info); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // struct Node { | |
| // descendants: Vec<usize>, | |
| // } | |
| // struct Graph { | |
| // nodes: Vec<Node>, | |
| // } | |
| struct Backtrack<'g> { | |
| g: &'g Graph, | |
| current_path: Vec<usize>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| using System.Buffers; | |
| using System.Text; | |
| BenchmarkRunner.Run<HeaderDecoder>(); | |
| public class HeaderDecoder | |
| { | |
| private static readonly SearchValues<char> s_dangerousCharacters = SearchValues.Create('\0', '\r', '\n'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/build/ci.profile.yml --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/grpc.benchmarks.yml --scenario grpcaspnetcoreserver-grpcnetclient --profile intel-lin-app --profile intel-load-load --variable scenario=serverstreaming --variable requestSize=0 --variable responseSize=0 --variable streams=70 --variable connections=20 --variable threads=20 --variable protocol=h3 --application.framework net9.0 --load.framework net10.0 --load.options.outputFiles <reporoot>\artifacts\bin\System.Net.Http\Release\net10.0-linux\System.Net.Http.dll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Net.Http; | |
| using System.Net; | |
| using System.Threading.Tasks; | |
| using System.Runtime.CompilerServices; | |
| class Program | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net.Sockets; | |
| using System.Text; | |
| // Relevant option names and values taken from Windows headers. | |
| (string Name, int Value)[] ipOptions = [ | |
| ("IP_TOS", 3), | |
| ("IP_TTL", 4), | |
| ]; | |
| (string Name, int Value)[] ipv6Options = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using SixLabors.ImageSharp; | |
| using SixLabors.ImageSharp.Memory; | |
| using System.Buffers; | |
| using System.Runtime.CompilerServices; | |
| if (!File.Exists("./img.jpg")) | |
| { | |
| using HttpClient client = new HttpClient(); | |
| client.DefaultRequestHeaders.Add("User-Agent", "Markus Moller's super cool bot"); | |
| Console.WriteLine("Downloading image..."); |
NewerOlder