mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-20 00:57:16 +00:00
Changes a suggested.
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
using MediaBrowser.Model.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Emby.Server.Implementations.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Extention to enable the service stack request to be stored in the HttpRequest object.
|
||||
/// </summary>
|
||||
public static class HttpContextExtension
|
||||
{
|
||||
private const string SERVICESTACKREQUEST = "ServiceRequestStack";
|
||||
|
||||
/// <summary>
|
||||
/// Set the service stack request.
|
||||
/// </summary>
|
||||
/// <param name="httpContext">The HttpContext instance.</param>
|
||||
/// <param name="request">The IRequest instance.</param>
|
||||
public static void SetServiceStackRequest(this HttpContext httpContext, IRequest request)
|
||||
{
|
||||
httpContext.Items[SERVICESTACKREQUEST] = request;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the service stack request.
|
||||
/// </summary>
|
||||
/// <param name="httpContext">The HttpContext instance.</param>
|
||||
/// <returns>The service stack request instance.</returns>
|
||||
public static IRequest GetServiceStack(this HttpContext httpContext)
|
||||
{
|
||||
return (IRequest)httpContext.Items[SERVICESTACKREQUEST];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Emby.Server.Implementations.HttpServer;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Model.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
Reference in New Issue
Block a user