mirror of
https://github.com/bitwarden/server
synced 2025-12-12 06:13:43 +00:00
22 lines
513 B
C#
22 lines
513 B
C#
using Microsoft.AspNetCore.Http;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Bit.Core.Utilities
|
|
{
|
|
public class CurrentContextMiddleware
|
|
{
|
|
private readonly RequestDelegate _next;
|
|
|
|
public CurrentContextMiddleware(RequestDelegate next)
|
|
{
|
|
_next = next;
|
|
}
|
|
|
|
public async Task Invoke(HttpContext httpContext, CurrentContext currentContext)
|
|
{
|
|
currentContext.Build(httpContext);
|
|
await _next.Invoke(httpContext);
|
|
}
|
|
}
|
|
}
|