File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed
src/Servers/Kestrel/Core/src/Internal/Http2 Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -695,23 +695,4 @@ void IPooledStream.DisposeCore()
695
695
}
696
696
697
697
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
- }
717
698
}
You can’t perform that action at this time.
0 commit comments