File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/KubernetesClient/Authentication Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ public TokenFileAuth(string tokenFile)
1717 TokenFile = tokenFile ;
1818 }
1919
20- #if NETSTANDARD2_1_OR_GREATER
20+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
2121 public async Task < AuthenticationHeaderValue > GetAuthenticationHeaderAsync ( CancellationToken cancellationToken )
2222#else
2323 public Task < AuthenticationHeaderValue > GetAuthenticationHeaderAsync ( CancellationToken cancellationToken )
2424#endif
2525 {
2626 if ( TokenExpiresAt < DateTime . UtcNow )
2727 {
28- #if NETSTANDARD2_1_OR_GREATER
28+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
2929 token = await File . ReadAllTextAsync ( TokenFile , cancellationToken )
3030 . ContinueWith ( r => r . Result . Trim ( ) , cancellationToken )
3131 . ConfigureAwait ( false ) ;
@@ -40,7 +40,7 @@ public Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(Cancellation
4040 // < 10-8-1 minute.
4141 TokenExpiresAt = DateTime . UtcNow . AddMinutes ( 1 ) ;
4242 }
43- #if NETSTANDARD2_1_OR_GREATER
43+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
4444 return new AuthenticationHeaderValue ( "Bearer" , token ) ;
4545#else
4646 return Task . FromResult ( new AuthenticationHeaderValue ( "Bearer" , token ) ) ;
You can’t perform that action at this time.
0 commit comments