diff --git a/src/Http/Routing/src/Matching/HostMatcherPolicy.cs b/src/Http/Routing/src/Matching/HostMatcherPolicy.cs index cb182af22a81..f99afdcfbd3e 100644 --- a/src/Http/Routing/src/Matching/HostMatcherPolicy.cs +++ b/src/Http/Routing/src/Matching/HostMatcherPolicy.cs @@ -109,7 +109,7 @@ public Task ApplyAsync(HttpContext httpContext, EndpointSelectorContext context, var port = ReadOnlySpan.Empty; // Split into host and port - var pivot = host.IndexOf(":"); + var pivot = host.IndexOf(':'); if (pivot >= 0) { port = host.Slice(pivot + 1); diff --git a/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs b/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs index 8fcc6eb50cbc..84ff83a765ea 100644 --- a/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs +++ b/src/Security/Authentication/JwtBearer/src/JwtBearerHandler.cs @@ -226,7 +226,7 @@ protected override async Task HandleChallengeAsync(AuthenticationProperties prop // 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(',');