diff --git a/src/Jackett.Server/Jackett.Server.csproj b/src/Jackett.Server/Jackett.Server.csproj index 97a8c0997..52b2e9cc5 100644 --- a/src/Jackett.Server/Jackett.Server.csproj +++ b/src/Jackett.Server/Jackett.Server.csproj @@ -33,7 +33,6 @@ - diff --git a/src/Jackett.Server/Program.cs b/src/Jackett.Server/Program.cs index 47dcb69c5..c43db3dc8 100644 --- a/src/Jackett.Server/Program.cs +++ b/src/Jackett.Server/Program.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Reflection; using System.Runtime.InteropServices; namespace Jackett.Server @@ -50,7 +49,7 @@ namespace Jackett.Server { //TODO: Remove libcurl once off owin bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("Core", StringComparison.OrdinalIgnoreCase) >= 0; - + if (runningOnDotNetCore) { options.Client = "httpclientnetcore"; @@ -182,6 +181,7 @@ namespace Jackett.Server WebHost.CreateDefaultBuilder(args) .UseConfiguration(Configuration) .UseContentRoot(contentRoot) + .UseWebRoot(contentRoot) .UseUrls(urls) .PreferHostingUrls(true) .UseStartup() diff --git a/src/Jackett.Server/Startup.cs b/src/Jackett.Server/Startup.cs index 9b161fe91..1e07d9c19 100644 --- a/src/Jackett.Server/Startup.cs +++ b/src/Jackett.Server/Startup.cs @@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.AspNetCore.Rewrite; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; using Newtonsoft.Json.Serialization; using System; using System.IO; @@ -128,13 +127,7 @@ namespace Jackett.Server app.UseRewriter(rewriteOptions); - app.UseFileServer(new FileServerOptions - { - FileProvider = new PhysicalFileProvider(Helper.ConfigService.GetContentFolder()), - RequestPath = "", - EnableDefaultFiles = true, - EnableDirectoryBrowsing = false - }); + app.UseStaticFiles(); app.UseAuthentication();