Class MiddlewareExtensions
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public static class MiddlewareExtensions
Methods
UseAntiforgeryFE(IApplicationBuilder, Func<HttpContext, bool>?, string[]?)
enable anti-forgery token verification middleware.
make sure to also add the anti-forgery services with builder.Services.AddAntiForgery()
Declaration
public static IApplicationBuilder UseAntiforgeryFE(this IApplicationBuilder app, Func<HttpContext, bool>? skipRequestFilter = null, string[]? additionalContentTypes = null)
Parameters
Type | Name | Description |
---|---|---|
IApplicationBuilder | app | |
Func<HttpContext, bool> | skipRequestFilter | an optional predicate which can be used to skip anti-forgery checks for requests that satisfy a given condition.
provide a function that returns |
string[] | additionalContentTypes | optional array of additional content-types to enforce antiforgery checks for (if the endpoint has enabled antiforgery). |
Returns
Type | Description |
---|---|
IApplicationBuilder |