Skip to content

Commit

Permalink
Merge pull request #1916 from microsoft/dpaul-HcFix
Browse files Browse the repository at this point in the history
Fix bug with NULL authLocation on unknown site location
  • Loading branch information
dpaulson45 committed Dec 21, 2023
2 parents 8cedc50 + deb8ca3 commit 7efeb88
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Diagnostics/HealthChecker/Analyzer/Get-IISAuthenticationType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ function Get-IISAuthenticationType {
}
} else {
Write-Verbose "authLocation was NULL, but shouldn't be a problem we just use the parent."
$index = $currentKey.LastIndexOf("/")

if ($index -eq -1) {
$continue = $false
Write-Verbose "No parent location. Need to determine how to address."
$getIisAuthenticationType[$failedKey].Add($appKey)
} else {
$currentKey = $currentKey.Substring(0, $index)
}
}
} elseif ($currentKey -ne $appKey) {
# If we are at a parent location we might not have all the locations in the config. So this could be okay.
Expand All @@ -196,6 +205,7 @@ function Get-IISAuthenticationType {
if ($index -eq -1) {
Write-Verbose "Didn't have root parent in the config file, this is odd."
$getIisAuthenticationType[$failedKey].Add($appKey)
$continue = $false
} else {
$currentKey = $currentKey.Substring(0, $index)
}
Expand Down

0 comments on commit 7efeb88

Please sign in to comment.