C# 클래스 Decision.Common.Filters.RedirectToCanonicalUrlAttribute

상속: System.Web.Mvc.FilterAttribute, IAuthorizationFilter
파일 보기 프로젝트 열기: rabbal/Decision

공개 메소드들

메소드 설명
OnAuthorization ( System.Web.Mvc.AuthorizationContext filterContext ) : void

Determines whether the HTTP request contains a non-canonical URL using TryGetCanonicalUrl, if it doesn't calls the HandleNonCanonicalRequest method.

RedirectToCanonicalUrlAttribute ( bool appendTrailingSlash, bool lowercaseUrls ) : System

Initializes a new instance of the RedirectToCanonicalUrlAttribute class.

보호된 메소드들

메소드 설명
HandleNonCanonicalRequest ( System.Web.Mvc.AuthorizationContext filterContext, string canonicalUrl ) : void

Handles HTTP requests for URL's that are not canonical. Performs a 301 Permanent Redirect to the canonical URL.

HasNoTrailingSlashAttribute ( System.Web.Mvc.AuthorizationContext filterContext ) : bool

Determines whether the specified action or its controller has the NoTrailingSlashAttribute attribute specified.

TryGetCanonicalUrl ( System.Web.Mvc.AuthorizationContext filterContext, string &canonicalUrl ) : bool

Determines whether the specified URl is canonical and if it is not, outputs the canonical URL.

메소드 상세

HandleNonCanonicalRequest() 보호된 메소드

Handles HTTP requests for URL's that are not canonical. Performs a 301 Permanent Redirect to the canonical URL.
protected HandleNonCanonicalRequest ( System.Web.Mvc.AuthorizationContext filterContext, string canonicalUrl ) : void
filterContext System.Web.Mvc.AuthorizationContext An object that encapsulates information that is required in order to use the /// attribute.
canonicalUrl string The canonical URL.
리턴 void

HasNoTrailingSlashAttribute() 보호된 메소드

Determines whether the specified action or its controller has the NoTrailingSlashAttribute attribute specified.
protected HasNoTrailingSlashAttribute ( System.Web.Mvc.AuthorizationContext filterContext ) : bool
filterContext System.Web.Mvc.AuthorizationContext The filter context.
리턴 bool

OnAuthorization() 공개 메소드

Determines whether the HTTP request contains a non-canonical URL using TryGetCanonicalUrl, if it doesn't calls the HandleNonCanonicalRequest 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.
리턴 void

RedirectToCanonicalUrlAttribute() 공개 메소드

Initializes a new instance of the RedirectToCanonicalUrlAttribute class.
public RedirectToCanonicalUrlAttribute ( bool appendTrailingSlash, bool lowercaseUrls ) : System
appendTrailingSlash bool If set to true append trailing slashes, otherwise strip trailing /// slashes.
lowercaseUrls bool If set to true lower-case all URL's.
리턴 System

TryGetCanonicalUrl() 보호된 메소드

Determines whether the specified URl is canonical and if it is not, outputs the canonical URL.
protected TryGetCanonicalUrl ( System.Web.Mvc.AuthorizationContext filterContext, string &canonicalUrl ) : bool
filterContext System.Web.Mvc.AuthorizationContext An object that encapsulates information that is required in order to use the /// attribute.
canonicalUrl string The canonical URL.
리턴 bool