Files
server/src/Core/Utilities/CurrentContextMiddleware.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
621 B
C#
Raw Normal View History

using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Settings;
2018-08-02 12:14:33 -04:00
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);
}
}
}