Class AcceptLanguageFilteringMiddleware
Middleware to filter requests based on the 'Accept-Language' header values against a configurable whitelist and blacklist.
Inherited Members
Namespace: Coree.NETASP.Middleware.AcceptLanguageFiltering
Assembly: Coree.NETASP.dll
Syntax
public class AcceptLanguageFilteringMiddleware
Constructors
| Edit this page View SourceAcceptLanguageFilteringMiddleware(RequestDelegate, ILogger<AcceptLanguageFilteringMiddleware>, IOptions<AcceptLanguageFilteringOptions>, IPointService)
Initializes a new instance of the AcceptLanguageFilteringMiddleware class.
Declaration
public AcceptLanguageFilteringMiddleware(RequestDelegate nextMiddleware, ILogger<AcceptLanguageFilteringMiddleware> logger, IOptions<AcceptLanguageFilteringOptions> options, IPointService pointService)
Parameters
Type | Name | Description |
---|---|---|
RequestDelegate | nextMiddleware | The next middleware component in the HTTP request processing pipeline. |
ILogger<AcceptLanguageFilteringMiddleware> | logger | The logger for logging information, warnings, and errors. |
IOptions<AcceptLanguageFilteringOptions> | options | The options containing the whitelist and blacklist of languages. |
IPointService | pointService |
Methods
| Edit this page View SourceInvokeAsync(HttpContext)
Processes a request to determine if the 'Accept-Language' header is in the whitelist or not in the blacklist before passing it to the next middleware.
Declaration
public Task InvokeAsync(HttpContext context)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The HTTP context for the current request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation of request processing. |