.IndexOf(...) >= 0 to .Contains(...) (#4688)
This commit is contained in:
parent
4a9a96cef7
commit
b2731d652d
|
|
@ -394,7 +394,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
|
|||
|
||||
// Check for CR in value
|
||||
var valueBuffer = new Span<byte>(headerLine + valueStart, valueEnd - valueStart + 1);
|
||||
if (valueBuffer.IndexOf(ByteCR) >= 0)
|
||||
if (valueBuffer.Contains(ByteCR))
|
||||
{
|
||||
RejectRequestHeader(headerLine, length);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
|
|||
return false;
|
||||
}
|
||||
|
||||
var pathEncoded = pathSegment.IndexOf('%') >= 0;
|
||||
var pathEncoded = pathSegment.Contains('%');
|
||||
|
||||
// Compare with Http1Connection.OnOriginFormTarget
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue