From aea4ef94713cc6806dc3bfc2bb31b8f05160e4e7 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Wed, 13 Nov 2019 10:35:55 +0100 Subject: [PATCH] Fix logic --- MediaBrowser.Api/BaseApiService.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs index 328bda50fc..55e25e0797 100644 --- a/MediaBrowser.Api/BaseApiService.cs +++ b/MediaBrowser.Api/BaseApiService.cs @@ -298,12 +298,24 @@ namespace MediaBrowser.Api var pathInfo = Parse(Request.PathInfo); var first = pathInfo[0]; + string baseUrl = ApiEntryPoint.Instance.ConfigurationManager.Configuration.BaseUrl; + // backwards compatibility - if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) - || string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase) - || string.Equals(first, ApiEntryPoint.Instance.ConfigurationManager.Configuration.BaseUrl)) + if (baseUrl.Length == 0 + && (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) + || string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase))) + { + index++; + } + else if (string.Equals(first, baseUrl)) { index++; + var second = pathInfo[1]; + if (string.Equals(second, "mediabrowser", StringComparison.OrdinalIgnoreCase) + || string.Equals(second, "emby", StringComparison.OrdinalIgnoreCase)) + { + index++; + } } return pathInfo[index];