diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-09-04 10:30:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-04 10:30:13 -0400 |
| commit | 376e4793e610838fc05db7fdd0372e5b7e6cb2d6 (patch) | |
| tree | 35c00381359e02bca6d8869d66612ce89a008949 /Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs | |
| parent | 559a7fc336a022c92f63a8d77b6eb3c2f915c290 (diff) | |
| parent | 021e218f754af8a1cf7f35e2a1d8286e813884e1 (diff) | |
Merge pull request #4035 from crobibero/api-doc-base-url
Fix apidoc routes with base url
Diffstat (limited to 'Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs')
| -rw-r--r-- | Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs index 9316737bd..ae3a3a1c5 100644 --- a/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs +++ b/Jellyfin.Server/Middleware/BaseUrlRedirectionMiddleware.cs @@ -44,11 +44,7 @@ namespace Jellyfin.Server.Middleware var localPath = httpContext.Request.Path.ToString(); var baseUrlPrefix = serverConfigurationManager.Configuration.BaseUrl; - if (string.Equals(localPath, baseUrlPrefix + "/", StringComparison.OrdinalIgnoreCase) - || string.Equals(localPath, baseUrlPrefix, StringComparison.OrdinalIgnoreCase) - || string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase) - || string.IsNullOrEmpty(localPath) - || !localPath.StartsWith(baseUrlPrefix, StringComparison.OrdinalIgnoreCase)) + if (!localPath.StartsWith(baseUrlPrefix, StringComparison.OrdinalIgnoreCase)) { // Always redirect back to the default path if the base prefix is invalid or missing _logger.LogDebug("Normalizing an URL at {LocalPath}", localPath); |
