Use .IndexOf(char/byte) where possible (#9539)
This commit is contained in:
parent
9b999b3afb
commit
48c97b425e
|
|
@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
var port = ReadOnlySpan<char>.Empty;
|
||||
|
||||
// Split into host and port
|
||||
var pivot = host.IndexOf(":");
|
||||
var pivot = host.IndexOf(':');
|
||||
if (pivot >= 0)
|
||||
{
|
||||
port = host.Slice(pivot + 1);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ namespace Microsoft.AspNetCore.Authentication.JwtBearer
|
|||
// https://tools.ietf.org/html/rfc6750#section-3.1
|
||||
// WWW-Authenticate: Bearer realm="example", error="invalid_token", error_description="The access token expired"
|
||||
var builder = new StringBuilder(Options.Challenge);
|
||||
if (Options.Challenge.IndexOf(" ", StringComparison.Ordinal) > 0)
|
||||
if (Options.Challenge.IndexOf(' ') > 0)
|
||||
{
|
||||
// Only add a comma after the first param, if any
|
||||
builder.Append(',');
|
||||
|
|
|
|||
Loading…
Reference in New Issue