1
0
mirror of https://github.com/bitwarden/server synced 2025-12-25 20:53:16 +00:00
Files
server/src/Core/Utilities/CurrentContextMiddleware.cs
2021-12-16 15:35:09 +01:00

24 lines
621 B
C#

using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Settings;
using Microsoft.AspNetCore.Http;
namespace Bit.Core.Utilities
{
public class CurrentContextMiddleware
{
private readonly RequestDelegate _next;
public CurrentContextMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext httpContext, ICurrentContext currentContext, GlobalSettings globalSettings)
{
await currentContext.BuildAsync(httpContext, globalSettings);
await _next.Invoke(httpContext);
}
}
}