diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-11-17 23:05:39 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-11-25 11:55:24 +0100 |
| commit | 3221e837f9758e90b91f0f6760af1c3b67e04c2d (patch) | |
| tree | 1b0910d5b4a952def733728cd5faa9a4f3cee504 /MediaBrowser.Model/Configuration/ServerConfiguration.cs | |
| parent | e7098f1997ee74eb3bdaad33836839ace6d80f64 (diff) | |
* Add support for multi segment base urls
* Make baseurl case-insensitive
Diffstat (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs')
| -rw-r--r-- | MediaBrowser.Model/Configuration/ServerConfiguration.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index b8abe49e3..9de6fef61 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -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); |
