C# Class Decision.Common.Filters.RedirectToHttpsAttribute

Inheritance: System.Web.Mvc.FilterAttribute, IAuthorizationFilter
Show file Open project: rabbal/Decision

Public Methods

Method Description
OnAuthorization ( System.Web.Mvc.AuthorizationContext filterContext ) : void

Determines whether a request is secured (HTTPS) and, if it is not, calls the HandleNonHttpsRequest method.

RedirectToHttpsAttribute ( bool permanent ) : System

Initializes a new instance of the RedirectToHttpsAttribute class.

Protected Methods

Method Description
HandleNonHttpsRequest ( System.Web.Mvc.AuthorizationContext filterContext ) : void

Handles unsecured HTTP requests that are sent to the action method.

Method Details

HandleNonHttpsRequest() protected method

Handles unsecured HTTP requests that are sent to the action method.
The HTTP request contains an invalid transfer method override. /// All GET requests are considered invalid. A HTTP 405 Method Not Allowed is thrown.
protected HandleNonHttpsRequest ( System.Web.Mvc.AuthorizationContext filterContext ) : void
filterContext System.Web.Mvc.AuthorizationContext An object that encapsulates information that is required in order to use the /// attribute.
return void

OnAuthorization() public method

Determines whether a request is secured (HTTPS) and, if it is not, calls the HandleNonHttpsRequest method.
The parameter is null.
public OnAuthorization ( System.Web.Mvc.AuthorizationContext filterContext ) : void
filterContext System.Web.Mvc.AuthorizationContext An object that encapsulates information that is required in order to use the /// attribute.
return void

RedirectToHttpsAttribute() public method

Initializes a new instance of the RedirectToHttpsAttribute class.
public RedirectToHttpsAttribute ( bool permanent ) : System
permanent bool if set to true the redirection should be permanent; otherwise, /// false.
return System