Skip to content

Commit be9d686

Browse files
committed
fb
1 parent 4d30127 commit be9d686

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ internal static partial class HttpUtilities
2929

3030
private static readonly UTF8Encoding DefaultRequestHeaderEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true);
3131

32-
private static readonly SearchValues<char> _nullAndNewLineSearchValues = SearchValues.Create(['\r', '\n', '\0']);
33-
3432
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3533
private static void SetKnownMethod(ulong mask, ulong knownMethodUlong, HttpMethod knownMethod, int length)
3634
{
@@ -127,7 +125,7 @@ public static string GetRequestHeaderString(this ReadOnlySpan<byte> span, string
127125
// New Line characters (CR, LF) are considered invalid at this point.
128126
// Null characters are also not allowed.
129127
var invalidCharIndex = checkForNewlineChars ?
130-
((ReadOnlySpan<char>)result).IndexOfAny(_nullAndNewLineSearchValues)
128+
((ReadOnlySpan<char>)result).IndexOfAny('\r', '\n', '\0')
131129
: ((ReadOnlySpan<char>)result).IndexOf('\0');
132130

133131
if (invalidCharIndex >= 0)

0 commit comments

Comments
 (0)