mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-07 18:24:19 -04:00
Changes a suggested.
This commit is contained in:
parent
0f696104ac
commit
f9b0816b80
@ -134,8 +134,7 @@ namespace Emby.Dlna.Api
|
|||||||
_dlnaManager = dlnaManager;
|
_dlnaManager = dlnaManager;
|
||||||
_resultFactory = httpResultFactory;
|
_resultFactory = httpResultFactory;
|
||||||
_configurationManager = configurationManager;
|
_configurationManager = configurationManager;
|
||||||
object request = httpContextAccessor?.HttpContext.Items["ServiceStackRequest"] ?? throw new ArgumentNullException(nameof(httpContextAccessor));
|
Request = httpContextAccessor?.HttpContext.GetServiceStack() ?? throw new ArgumentNullException(nameof(httpContextAccessor));
|
||||||
Request = (IRequest)request;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetHeader(string name)
|
private string GetHeader(string name)
|
||||||
|
@ -6,6 +6,7 @@ using System.Reflection;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Emby.Server.Implementations.HttpServer;
|
using Emby.Server.Implementations.HttpServer;
|
||||||
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace Emby.Server.Implementations.Services
|
namespace MediaBrowser.Common.Extensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extention to enable the service stack request to be stored in the HttpRequest object.
|
/// Extention to enable the service stack request to be stored in the HttpRequest object.
|
||||||
|
/// Static class containing extension methods for <see cref="HttpContext"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class HttpContextExtension
|
public static class HttpContextExtensions
|
||||||
{
|
{
|
||||||
private const string SERVICESTACKREQUEST = "ServiceRequestStack";
|
private const string SERVICESTACKREQUEST = "ServiceStackRequest";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set the service stack request.
|
/// Set the ServiceStack request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="httpContext">The HttpContext instance.</param>
|
/// <param name="httpContext">The HttpContext instance.</param>
|
||||||
/// <param name="request">The IRequest instance.</param>
|
/// <param name="request">The service stack request instance.</param>
|
||||||
public static void SetServiceStackRequest(this HttpContext httpContext, IRequest request)
|
public static void SetServiceStackRequest(this HttpContext httpContext, IRequest request)
|
||||||
{
|
{
|
||||||
httpContext.Items[SERVICESTACKREQUEST] = request;
|
httpContext.Items[SERVICESTACKREQUEST] = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the service stack request.
|
/// Get the ServiceStack request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="httpContext">The HttpContext instance.</param>
|
/// <param name="httpContext">The HttpContext instance.</param>
|
||||||
/// <returns>The service stack request instance.</returns>
|
/// <returns>The service stack request instance.</returns>
|
Loading…
x
Reference in New Issue
Block a user