diff options
| author | crobibero <cody@robibe.ro> | 2020-09-05 09:00:55 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-05 09:00:55 -0600 |
| commit | 8a08111adcc03d93acec60c783d204f98e99c83a (patch) | |
| tree | d7591de2a59fd6be64573995c6fd6de44eae67f1 /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | |
| parent | 1de22af6466a691e023dd70b2032d5e3af3bdc6b (diff) | |
| parent | 6d154041b9e456ab97e1066f525e4d9732fb672a (diff) | |
Merge remote-tracking branch 'upstream/master' into dynamic-cors
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index 896f5f0b8..8dcce93a4 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; -using Jellyfin.Api; using Jellyfin.Api.Auth; using Jellyfin.Api.Auth.DefaultAuthorizationPolicy; using Jellyfin.Api.Auth.DownloadPolicy; @@ -134,13 +133,11 @@ namespace Jellyfin.Server.Extensions /// Extension method for adding the jellyfin API to the service collection. /// </summary> /// <param name="serviceCollection">The service collection.</param> - /// <param name="baseUrl">The base url for the API.</param> - /// <param name="pluginAssemblies">An IEnumberable containing all plugin assemblies with API controllers.</param> + /// <param name="pluginAssemblies">An IEnumerable containing all plugin assemblies with API controllers.</param> /// /// <param name="corsHosts">The configured cors hosts.</param> /// <returns>The MVC builder.</returns> public static IMvcBuilder AddJellyfinApi( this IServiceCollection serviceCollection, - string baseUrl, IEnumerable<Assembly> pluginAssemblies, string[] corsHosts) { @@ -155,7 +152,9 @@ namespace Jellyfin.Server.Extensions }) .AddMvc(opts => { - opts.UseGeneralRoutePrefix(baseUrl); + // Allow requester to change between camelCase and PascalCase + opts.RespectBrowserAcceptHeader = true; + opts.OutputFormatters.Insert(0, new CamelCaseJsonProfileFormatter()); opts.OutputFormatters.Insert(0, new PascalCaseJsonProfileFormatter()); |
