diff options
Diffstat (limited to 'src/main.lib/Clients/IIS/IISHelper.cs')
-rw-r--r-- | src/main.lib/Clients/IIS/IISHelper.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main.lib/Clients/IIS/IISHelper.cs b/src/main.lib/Clients/IIS/IISHelper.cs index 63a8649..7f28176 100644 --- a/src/main.lib/Clients/IIS/IISHelper.cs +++ b/src/main.lib/Clients/IIS/IISHelper.cs @@ -79,12 +79,17 @@ namespace PKISharp.WACS.Clients.IIS Where(sb => !string.IsNullOrWhiteSpace(sb.binding.Host)). ToList(); + static string lookupKey(IIISSite site, IIISBinding binding) => + site.Id + "#" + binding.BindingInformation.ToLower(); + // Option: hide http bindings when there are already https equivalents - var https = siteBindings.Where(sb => - sb.binding.Protocol == "https" || - sb.site.Bindings.Any(other => - other.Protocol == "https" && - string.Equals(sb.binding.Host, other.Host, StringComparison.InvariantCultureIgnoreCase))).ToList(); + var https = siteBindings + .Where(sb => + sb.binding.Protocol == "https" || + sb.site.Bindings.Any(other => + other.Protocol == "https" && + string.Equals(sb.binding.Host, other.Host, StringComparison.InvariantCultureIgnoreCase))) + .ToDictionary(sb => lookupKey(sb.site, sb.binding)); var targets = siteBindings. Select(sb => new @@ -92,7 +97,7 @@ namespace PKISharp.WACS.Clients.IIS host = sb.binding.Host.ToLower(), sb.site, sb.binding, - https = https.Contains(sb) + https = https.ContainsKey(lookupKey(sb.site, sb.binding)) }). Select(sbi => new IISBindingOption(sbi.host, _idnMapping.GetAscii(sbi.host)) { |