Skip to content

Commit 40efbe5

Browse files
committed
some fx fixes
1 parent 2180699 commit 40efbe5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ZNetCS.AspNetCore.Authentication.Basic/BasicAuthenticationHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public BasicAuthenticationHandler(IOptionsMonitor<BasicAuthenticationOptions> op
101101

102102
/// <inheritdoc/>
103103
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Just for validation, the quickest")]
104-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "Invalid overload; known bug in code analysis")]
105104
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
106105
{
107106
// RFC 7230 section 3.2.2
@@ -123,7 +122,12 @@ protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
123122
return AuthenticateResult.NoResult();
124123
}
125124

125+
#if NET461 || NETSTANDARD2_0
126+
126127
string credentials = basicAuthorizationHeader.Replace($"{Basic} ", string.Empty).Trim();
128+
#else
129+
string credentials = basicAuthorizationHeader.Replace($"{Basic} ", string.Empty, StringComparison.InvariantCultureIgnoreCase).Trim();
130+
#endif
127131

128132
if (string.IsNullOrEmpty(credentials))
129133
{

0 commit comments

Comments
 (0)