mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-11 00:32:52 +01:00
Merge remote-tracking branch 'upstream/master' into NetworkPR2
This commit is contained in:
@@ -16,6 +16,7 @@ using Jellyfin.Api.Auth.LocalAccessPolicy;
|
||||
using Jellyfin.Api.Auth.RequiresElevationPolicy;
|
||||
using Jellyfin.Api.Constants;
|
||||
using Jellyfin.Api.Controllers;
|
||||
using Jellyfin.Api.ModelBinders;
|
||||
using Jellyfin.Server.Configuration;
|
||||
using Jellyfin.Server.Filters;
|
||||
using Jellyfin.Server.Formatters;
|
||||
@@ -166,6 +167,8 @@ namespace Jellyfin.Server.Extensions
|
||||
|
||||
opts.OutputFormatters.Add(new CssOutputFormatter());
|
||||
opts.OutputFormatters.Add(new XmlOutputFormatter());
|
||||
|
||||
opts.ModelBinderProviders.Insert(0, new CommaDelimitedArrayModelBinderProvider());
|
||||
})
|
||||
|
||||
// Clear app parts to avoid other assemblies being picked up
|
||||
|
||||
@@ -125,8 +125,8 @@ namespace Jellyfin.Server.Middleware
|
||||
switch (ex)
|
||||
{
|
||||
case ArgumentException _: return StatusCodes.Status400BadRequest;
|
||||
case AuthenticationException _:
|
||||
case SecurityException _: return StatusCodes.Status401Unauthorized;
|
||||
case AuthenticationException _: return StatusCodes.Status401Unauthorized;
|
||||
case SecurityException _: return StatusCodes.Status403Forbidden;
|
||||
case DirectoryNotFoundException _:
|
||||
case FileNotFoundException _:
|
||||
case ResourceNotFoundException _: return StatusCodes.Status404NotFound;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Mime;
|
||||
using Jellyfin.Api.TypeConverters;
|
||||
using Jellyfin.Networking.Configuration;
|
||||
using Jellyfin.Server.Extensions;
|
||||
@@ -12,6 +13,7 @@ using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Extensions;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
@@ -124,10 +126,15 @@ namespace Jellyfin.Server
|
||||
mainApp.UseStaticFiles();
|
||||
if (appConfig.HostWebClient())
|
||||
{
|
||||
var extensionProvider = new FileExtensionContentTypeProvider();
|
||||
|
||||
// subtitles octopus requires .data files.
|
||||
extensionProvider.Mappings.Add(".data", MediaTypeNames.Application.Octet);
|
||||
mainApp.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = new PhysicalFileProvider(_serverConfigurationManager.ApplicationPaths.WebPath),
|
||||
RequestPath = "/web"
|
||||
RequestPath = "/web",
|
||||
ContentTypeProvider = extensionProvider
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user