Skip to content

Commit 55d6262

Browse files
author
Michael J. Lyons (XBOX)
committed
Apply code review feedback to use more appropriate helper functions in parsing a boolean config option
1 parent 52c1be9 commit 55d6262

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/shared/Microsoft.AzureRepos/AzureReposHostProvider.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,11 @@ private bool UseServicePrincipal(out ServicePrincipalIdentity sp)
549549

550550
if (hasCertThumbprint)
551551
{
552-
bool hasX5CSetting = _context.Settings.TryGetSetting(
552+
sp.SendX5C = _context.Settings.TryGetSetting(
553553
AzureDevOpsConstants.EnvironmentVariables.ServicePrincipalCertificateSendX5C,
554554
Constants.GitConfiguration.Credential.SectionName,
555555
AzureDevOpsConstants.GitConfiguration.Credential.ServicePrincipalCertificateSendX5C,
556-
out string certHasX5C);
557-
558-
sp.SendX5C = !hasX5CSetting || certHasX5C != "false";
556+
out string certHasX5CStr) && certHasX5CStr.ToBooleanyOrDefault(false);
559557

560558
X509Certificate2 cert = X509Utils.GetCertificateByThumbprint(certThumbprint);
561559
if (cert is null)

0 commit comments

Comments
 (0)