diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-03-15 17:42:57 +0100 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-03-15 17:42:57 +0100 |
| commit | 05ab61200a181ff39034a5c3ba30a4ee2672971d (patch) | |
| tree | cfb623d705da1aa6eb59bff958d2a57a00742434 /Jellyfin.Server/Program.cs | |
| parent | 602112fba433fa8919133d7ff292b0cd5a912aa2 (diff) | |
Do not call UseContentRoot() on the web host builder
This call has nothing to do with static web content and should not have ever been called with the web content path: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/?view=aspnetcore-3.1&tabs=windows#content-root
Since this call is removed, the ContentRoot property is also removed from ApplicationHost as it is no longer needed.
Finally, move validation of the static content path to the DashboardService where it is actually used.
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index bfb2fc6b5..67251eb24 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -243,7 +243,7 @@ namespace Jellyfin.Server IConfiguration startupConfig, IApplicationPaths appPaths) { - var webhostBuilder = new WebHostBuilder() + return new WebHostBuilder() .UseKestrel(options => { var addresses = appHost.ServerConfigurationManager @@ -289,24 +289,6 @@ namespace Jellyfin.Server services.TryAdd(serviceCollection); }) .UseStartup<Startup>(); - - // Set up static content hosting unless it has been disabled via config - if (!startupConfig.NoWebContent()) - { - // Fail startup if the web content does not exist - if (!Directory.Exists(appHost.ContentRoot) || !Directory.GetFiles(appHost.ContentRoot).Any()) - { - throw new InvalidOperationException( - "The server is expected to host web content, but the provided content directory is either " + - $"invalid or empty: {appHost.ContentRoot}. If you do not want to host web content with the " + - $"server, you may set the '{MediaBrowser.Controller.Extensions.ConfigurationExtensions.NoWebContentKey}' flag."); - } - - // Configure the web host to host the static web content - webhostBuilder.UseContentRoot(appHost.ContentRoot); - } - - return webhostBuilder; } /// <summary> |
