Fix the configuration key name for PreferHostingUrls (#1034)

This commit is contained in:
David Fowler 2017-04-22 10:12:16 -07:00 committed by GitHub
parent 383a13f1f9
commit 58cc0bc3f9
3 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ namespace Microsoft.AspNetCore.Hosting
/// <returns>The <see cref="IWebHostBuilder"/>.</returns>
public static IWebHostBuilder PreferHostingUrls(this IWebHostBuilder hostBuilder, bool preferHostingUrls)
{
return hostBuilder.UseSetting(WebHostDefaults.PreferHostingUrls, preferHostingUrls ? "true" : "false");
return hostBuilder.UseSetting(WebHostDefaults.PreferHostingUrlsKey, preferHostingUrls ? "true" : "false");
}
/// <summary>

View File

@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Hosting
public static readonly string CaptureStartupErrorsKey = "captureStartupErrors";
public static readonly string ServerUrlsKey = "urls";
public static readonly string ContentRootKey = "contentRoot";
public static readonly string PreferHostingUrls = "preferHostingUrls";
public static readonly string PreferHostingUrlsKey = "preferHostingUrls";
public static readonly string ShutdownTimeoutKey = "shutdownTimeoutSeconds";
}

View File

@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
WebRoot = configuration[WebHostDefaults.WebRootKey];
ContentRootPath = configuration[WebHostDefaults.ContentRootKey];
HostingStartupAssemblies = configuration[WebHostDefaults.HostingStartupAssembliesKey]?.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) ?? new string[0];
PreferHostingUrls = ParseBool(configuration, WebHostDefaults.PreferHostingUrls);
PreferHostingUrls = ParseBool(configuration, WebHostDefaults.PreferHostingUrlsKey);
var timeout = configuration[WebHostDefaults.ShutdownTimeoutKey];
if (!string.IsNullOrEmpty(timeout)