You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
851 B
39 lines
851 B
// Copyright (c) André N. Klingsheim. See License.txt in the project root for license information.
|
|
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNet.Builder;
|
|
using Microsoft.AspNet.Http;
|
|
|
|
namespace NWebsec.Middleware.Middleware
|
|
{
|
|
public class MiddlewareBase
|
|
{
|
|
private readonly RequestDelegate _next;
|
|
|
|
public MiddlewareBase(RequestDelegate next)
|
|
{
|
|
_next = next;
|
|
}
|
|
|
|
public async Task Invoke(HttpContext context)
|
|
{
|
|
|
|
PreInvokeNext(context);
|
|
|
|
if (_next != null)
|
|
{
|
|
await _next(context);
|
|
}
|
|
|
|
PostInvokeNext(context);
|
|
}
|
|
|
|
internal virtual void PreInvokeNext(HttpContext context)
|
|
{
|
|
}
|
|
|
|
internal virtual void PostInvokeNext(HttpContext context)
|
|
{
|
|
}
|
|
}
|
|
}
|