Skip to content

Commit 939b765

Browse files
committed
Clean up
1 parent 9a9789e commit 939b765

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -695,23 +695,4 @@ void IPooledStream.DisposeCore()
695695
}
696696

697697
long IPooledStream.PoolExpirationTicks => DrainExpirationTicks;
698-
699-
internal void ValidateHeaderValue(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value)
700-
{
701-
// Validate the value doesn't contain newline characters.
702-
// Doing this once when a value is added to the dynamic table avoids the need to repeat it every request.
703-
if (ReferenceEquals(KestrelServerOptions.DefaultHeaderEncodingSelector, HttpRequestHeaders.EncodingSelector))
704-
{
705-
if (value.IndexOfAny((byte)'\r', (byte)'\n') >= 0)
706-
{
707-
throw new InvalidOperationException("Newline characters (CR/LF) are not allowed in request headers.");
708-
}
709-
}
710-
else
711-
{
712-
// Errors if invalid new line characters are in header.
713-
// Hacky: If a custom encoding selector is present then the name and value are allocated when value is added to dynamic table.
714-
_ = value.GetRequestHeaderString(name.GetHeaderName(), HttpRequestHeaders.EncodingSelector, checkForNewlineChars: true);
715-
}
716-
}
717698
}

0 commit comments

Comments
 (0)