diff options
| author | crobibero <cody@robibe.ro> | 2020-09-04 16:42:40 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-04 16:42:40 -0600 |
| commit | d5eb246557f9c943d8e3c5ddcc357ef351425deb (patch) | |
| tree | 99b257fa694de3c263767aa44c8932ca21348dc2 /Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | |
| parent | 4fc611bf29c9d19c333d60c23325ae2b20900de1 (diff) | |
| parent | d8c6d291829f6a80ad1c13e039293f04083470f0 (diff) | |
Merge remote-tracking branch 'upstream/master' into api-stream-return
Diffstat (limited to 'Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs')
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index 04b611123..31454265a 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; @@ -19,7 +18,6 @@ using Jellyfin.Api.Controllers; using Jellyfin.Server.Filters; using Jellyfin.Server.Formatters; using Jellyfin.Server.Models; -using MediaBrowser.Common; using MediaBrowser.Common.Json; using MediaBrowser.Model.Entities; using Microsoft.AspNetCore.Authentication; @@ -136,10 +134,9 @@ 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> /// <returns>The MVC builder.</returns> - public static IMvcBuilder AddJellyfinApi(this IServiceCollection serviceCollection, string baseUrl, IEnumerable<Assembly> pluginAssemblies) + public static IMvcBuilder AddJellyfinApi(this IServiceCollection serviceCollection, IEnumerable<Assembly> pluginAssemblies) { IMvcBuilder mvcBuilder = serviceCollection .AddCors(options => @@ -152,7 +149,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()); |
