* Add support for multi segment base urls

* Make baseurl case-insensitive
This commit is contained in:
Bond_009
2019-11-17 23:05:39 +01:00
committed by Bond-009
parent e7098f1997
commit 3221e837f9
73 changed files with 1285 additions and 742 deletions

View File

@@ -172,16 +172,18 @@ namespace MediaBrowser.Model.Configuration
if (string.IsNullOrWhiteSpace(value))
{
// If baseUrl is empty, set an empty prefix string
value = string.Empty;
_baseUrl = string.Empty;
return;
}
else if (!value.StartsWith("/"))
if (value[0] != '/')
{
// If baseUrl was not configured with a leading slash, append one for consistency
value = "/" + value;
}
// Normalize the end of the string
if (value.EndsWith("/"))
if (value[value.Length - 1] == '/')
{
// If baseUrl was configured with a trailing slash, remove it for consistency
value = value.Remove(value.Length - 1);