File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,14 @@ namespace Beefweb.Client;
55/// <summary>
66/// Credentials for accessing API.
77/// </summary>
8- /// <param name="User ">User name.</param>
8+ /// <param name="UserName ">User name.</param>
99/// <param name="Password">Password.</param>
10- public record ApiCredentials ( string User , string Password )
10+ public record ApiCredentials ( string UserName , string Password )
1111{
1212 /// <summary>
13- /// If true, both <see cref="User "/> and <see cref="Password"/> are empty.
13+ /// If true, both <see cref="UserName "/> and <see cref="Password"/> are empty.
1414 /// </summary>
15- public bool IsEmpty => User . Length == 0 && Password . Length == 0 ;
15+ public bool IsEmpty => UserName . Length == 0 && Password . Length == 0 ;
1616
1717 /// <summary>
1818 /// Constructs <see cref="ApiCredentials"/> based on <see cref="Uri.UserInfo"/>.
Original file line number Diff line number Diff line change @@ -227,7 +227,9 @@ private static async ValueTask ThrowResponseError(
227227 if ( credentials == null || credentials . IsEmpty )
228228 return null ;
229229
230- var parameter = Convert . ToBase64String ( Encoding . UTF8 . GetBytes ( credentials . User + ":" + credentials . Password ) ) ;
230+ var parameter = Convert . ToBase64String (
231+ Encoding . UTF8 . GetBytes ( credentials . UserName + ":" + credentials . Password ) ) ;
232+
231233 return new AuthenticationHeaderValue ( "Basic" , parameter ) ;
232234 }
233235
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public void FromUri_UnescapesValues()
2121 var uri = builder . Uri ;
2222 var credentials = ApiCredentials . FromUri ( uri ) ;
2323 credentials . Should ( ) . NotBeNull ( ) ;
24- credentials ! . User . Should ( ) . Be ( userName ) ;
24+ credentials ! . UserName . Should ( ) . Be ( userName ) ;
2525 credentials . Password . Should ( ) . Be ( password ) ;
2626 }
2727}
You can’t perform that action at this time.
0 commit comments