Fix method HttpHeadersNonValidated uses to get HeaderDescriptor (#62150)
authorStephen Toub <stoub@microsoft.com>
Tue, 30 Nov 2021 15:04:56 +0000 (10:04 -0500)
committerGitHub <noreply@github.com>
Tue, 30 Nov 2021 15:04:56 +0000 (10:04 -0500)
commitaa03df027b744bb7f89754559e4f32a667dd14e7
tree77276a9da28b4bc8dabd9e40fdfbb150e5bdd7e8
parent9857fe0e961aea417969fd265745428a372421bb
Fix method HttpHeadersNonValidated uses to get HeaderDescriptor (#62150)

We have two non-public methods for getting a HeaderDescriptor from a string name, one static on HeaderDescriptor and one instance on HttpHeaders.  HttpHeadersNonValidated was using the former, but this then doesn't take into account custom logic used by HttpHeaders in other methods, like TryAddWithoutValidation, which means some methods on HttpHeadersNonValidated can't find the corresponding headers.
src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs
src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeadersNonValidated.cs
src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs