From 448e6787e2cad4f048b63a2d940cbcfc23b06187 Mon Sep 17 00:00:00 2001 From: Chris R Date: Wed, 7 Jun 2017 15:34:02 -0700 Subject: [PATCH] Fix auth enabled check --- .../WebHostBuilderIISExtensions.cs | 2 +- test/TestSites/StartupHelloWorld.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs index e4c5875bd6..1417c532ac 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/WebHostBuilderIISExtensions.cs @@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Hosting else { // Lightup a new ANCM variable that tells us if auth is enabled. - foreach (var authType in iisAuth.Split(';')) + foreach (var authType in iisAuth.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { if (!string.Equals(authType, "anonymous", StringComparison.OrdinalIgnoreCase)) { diff --git a/test/TestSites/StartupHelloWorld.cs b/test/TestSites/StartupHelloWorld.cs index 1fa394eba8..a406626ede 100644 --- a/test/TestSites/StartupHelloWorld.cs +++ b/test/TestSites/StartupHelloWorld.cs @@ -42,11 +42,11 @@ namespace TestSites var authScheme = (await authProvider.GetAllSchemesAsync()).SingleOrDefault(); if (string.IsNullOrEmpty(iisAuth)) { - await ctx.Response.WriteAsync("backcompat;" + authScheme?.Name ?? "null"); + await ctx.Response.WriteAsync("backcompat;" + (authScheme?.Name ?? "null")); } else { - await ctx.Response.WriteAsync("latest;" + authScheme?.Name ?? "null"); + await ctx.Response.WriteAsync("latest;" + (authScheme?.Name ?? "null")); } return; }