Skip to content

Commit 2312991

Browse files
Remove Utf8EncodingSealed from Kestrel (#33822)
1 parent c8d548c commit 2312991

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs

+1-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ internal static partial class HttpUtilities
2727
private const ulong _http10VersionLong = 3471766442030158920; // GetAsciiStringAsLong("HTTP/1.0"); const results in better codegen
2828
private const ulong _http11VersionLong = 3543824036068086856; // GetAsciiStringAsLong("HTTP/1.1"); const results in better codegen
2929

30-
private static readonly UTF8EncodingSealed DefaultRequestHeaderEncoding = new UTF8EncodingSealed();
30+
private static readonly UTF8Encoding DefaultRequestHeaderEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
3131
private static readonly SpanAction<char, IntPtr> s_getHeaderName = GetHeaderName;
3232

3333
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -524,13 +524,5 @@ private static bool IsHex(char ch)
524524
// Check if less than 6 representing chars 'a' - 'f'
525525
|| (uint)((ch | 32) - 'a') < 6u;
526526
}
527-
528-
// Allow for de-virtualization (see https://github.com/dotnet/coreclr/pull/9230)
529-
private sealed class UTF8EncodingSealed : UTF8Encoding
530-
{
531-
public UTF8EncodingSealed() : base(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true) { }
532-
533-
public override byte[] GetPreamble() => Array.Empty<byte>();
534-
}
535527
}
536528
}

0 commit comments

Comments
 (0)