C# Class ImageProcessor.Web.HttpModules.ImageProcessingModule

Processes any image requests within the web application.
Inheritance: IHttpModule
Datei anzeigen Open project: JimBobSquarePants/ImageProcessor

Public Methods

Method Description
AddCorsRequestHeaders ( HttpContext context ) : void

Adds response headers allowing Cross Origin Requests if the current origin request passes sanitizing rules.

Dispose ( ) : void

Disposes of the resources (other than memory) used by the module that implements T:System.Web.IHttpModule.

Init ( System.Web.HttpApplication application ) : void

Initializes a module and prepares it to handle requests.

SetHeaders ( HttpContext context, string responseType, string dependencyPaths, int maxDays, HttpStatusCode statusCode = null ) : void

This will make the browser and server keep the output in its cache and thereby improve performance.

Private Methods

Method Description
CheckQuerystringHandler ( HttpContext context, string queryString, string rawUrl ) : string
DecodeUrlString ( string url ) : string

Decodes a url string.

Dispose ( bool disposing ) : void

Disposes the object and frees resources for the Garbage Collector.

GetImageServiceForRequest ( string url, string applicationPath ) : IImageService

Gets the correct IImageService for the given request.

OnEndRequest ( object sender, EventArgs e ) : Task

Occurs when the ASP.NET event handler finishes execution.

OnValidatingRequest ( ValidatingRequestEventArgs args ) : void

Raises the ValidatingRequest event

ParseAnimationMode ( string queryString, bool &process ) : AnimationProcessMode

Gets the animation mode passed in through the querystring, defaults to the default behaviour (All) if nothing found.

ParseCacheBuster ( string queryString ) : bool

Return a value indicating whether common cache buster variables are being passed through.

PostAuthorizeRequest ( object sender, EventArgs e ) : Task

Occurs when the user for the current request has been authorized.

PostReleaseRequestState ( object sender, EventArgs e ) : void

Occurs when ASP.NET has completed executing all request event handlers and the request state data has been stored.

ProcessImageAsync ( HttpContext context ) : Task

Processes the image.

ReplacePresetsInQueryString ( string queryString ) : string

Replaces preset values stored in the configuration in the querystring.

Method Details

AddCorsRequestHeaders() public static method

Adds response headers allowing Cross Origin Requests if the current origin request passes sanitizing rules.
public static AddCorsRequestHeaders ( HttpContext context ) : void
context System.Web.HttpContext /// the HttpContext object that provides /// references to the intrinsic server objects ///
return void

Dispose() public method

Disposes of the resources (other than memory) used by the module that implements T:System.Web.IHttpModule.
public Dispose ( ) : void
return void

Init() public method

Initializes a module and prepares it to handle requests.
public Init ( System.Web.HttpApplication application ) : void
application System.Web.HttpApplication /// An that provides /// access to the methods, properties, and events common to all /// application objects within an ASP.NET application ///
return void

SetHeaders() public static method

This will make the browser and server keep the output in its cache and thereby improve performance.
public static SetHeaders ( HttpContext context, string responseType, string dependencyPaths, int maxDays, HttpStatusCode statusCode = null ) : void
context System.Web.HttpContext /// the HttpContext object that provides /// references to the intrinsic server objects ///
responseType string The HTTP MIME type to send.
dependencyPaths string The dependency path for the cache dependency.
maxDays int The maximum number of days to store the image in the browser cache.
statusCode HttpStatusCode An optional status code to send to the response.
return void