Table of Contents

Class ImageSharpMiddleware

Namespace
SixLabors.ImageSharp.Web.Middleware
Assembly
SixLabors.ImageSharp.Web.dll

Middleware for handling the processing of images via image requests.

public class ImageSharpMiddleware
Inheritance
ImageSharpMiddleware
Inherited Members

Constructors

ImageSharpMiddleware(RequestDelegate, IOptions<ImageSharpMiddlewareOptions>, ILoggerFactory, IRequestParser, IEnumerable<IImageProvider>, IEnumerable<IImageWebProcessor>, IImageCache, ICacheKey, ICacheHash, CommandParser, FormatUtilities, AsyncKeyReaderWriterLock<string>, RequestAuthorizationUtilities)

Initializes a new instance of the ImageSharpMiddleware class.

public ImageSharpMiddleware(RequestDelegate next, IOptions<ImageSharpMiddlewareOptions> options, ILoggerFactory loggerFactory, IRequestParser requestParser, IEnumerable<IImageProvider> resolvers, IEnumerable<IImageWebProcessor> processors, IImageCache cache, ICacheKey cacheKey, ICacheHash cacheHash, CommandParser commandParser, FormatUtilities formatUtilities, AsyncKeyReaderWriterLock<string> asyncKeyLock, RequestAuthorizationUtilities requestAuthorizationUtilities)

Parameters

next RequestDelegate

The next middleware in the pipeline.

options IOptions<ImageSharpMiddlewareOptions>

The middleware configuration options.

loggerFactory ILoggerFactory

An ILoggerFactory instance used to create loggers.

requestParser IRequestParser

An IRequestParser instance used to parse image requests for commands.

resolvers IEnumerable<IImageProvider>

A collection of IImageProvider instances used to resolve images.

processors IEnumerable<IImageWebProcessor>

A collection of IImageWebProcessor instances used to process images.

cache IImageCache

An IImageCache instance used for caching images.

cacheKey ICacheKey

An ICacheKey instance used for creating cache keys.

cacheHash ICacheHash

An ICacheHashinstance used for calculating cached file names.

commandParser CommandParser

The command parser.

formatUtilities FormatUtilities

Contains various format helper methods based on the current configuration.

asyncKeyLock AsyncKeyReaderWriterLock<string>

The async key lock.

requestAuthorizationUtilities RequestAuthorizationUtilities

Contains helpers that allow authorization of image requests.

Methods

Invoke(HttpContext)

Performs operations upon the current request.

public Task Invoke(HttpContext httpContext)

Parameters

httpContext HttpContext

The current HTTP request context.

Returns

Task

The Task.