Fix ASM accessing HttpRequest.Headers on .NET Framework without guarding#8611
Conversation
BenchmarksBenchmark execution time: 2026-05-12 13:41:32 Comparing candidate commit 279738a in PR branch Some scenarios are present only in baseline or only in candidate runs. If you didn't create or remove some scenarios in your branch, this maybe a sign of crashed benchmarks 💥💥💥 Scenarios present only in baseline:
Found 1 performance improvements and 2 performance regressions! Performance is the same for 48 metrics, 21 unstable metrics, 87 known flaky benchmarks, 39 flaky benchmarks without significant changes.
|
Summary of changes
HttpRequestValidationExceptionleaking in ASM pathsReason for change
Calling
HttpRequest.Headerscan throw anHttpRequestValidationExceptionif the headers contain "dangerous values". We guarded against that in #5943 by adding a helper, but in #6164 we refactored, and stopped using it.Implementation details
RequestDataHelper.GetHeaders()instead of callingrequest.Headersdirectly.SecurityCoordinator.ExtractHeaders()by allowing you to pass the collection in to the method, and passing that through to theFunc. Not required, just a minor perf optimizationTest coverage
Meh - correctness should be covered by existing tests. Adding a regression test seems overkill tbh