.IndexOf(...) >= 0 to .Contains(...) (#4688)

This commit is contained in:
Ben Adams 2018-12-13 23:40:09 +00:00 committed by James Newton-King
parent 4a9a96cef7
commit b2731d652d
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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