ServerConfiguration: add basePathOverride validation/normalization

This commit is contained in:
kaso17 2017-08-30 11:51:25 +02:00
parent 0143bdfe14
commit 1689c46c91
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ namespace Jackett.Controllers.V20
bool preRelease = config.prerelease;
bool logging = config.logging;
string basePathOverride = config.basepathoverride;
if (basePathOverride != null)
{
basePathOverride = basePathOverride.TrimEnd('/');
if (!string.IsNullOrWhiteSpace(basePathOverride) && !basePathOverride.StartsWith("/"))
throw new Exception("The Base Path Override must start with a /");
}
string omdbApiKey = config.omdbkey;
Engine.Server.Config.UpdateDisabled = updateDisabled;