RequireHttpsAttribute.HandleNonHttpsRequest(AuthorizationFilterContext) Method


Called from OnAuthorization(AuthorizationFilterContext) if the request is not received over HTTPS. Expectation is Result will not be null after this method returns.

 virtual void HandleNonHttpsRequest(Microsoft::AspNetCore::Mvc::Filters::AuthorizationFilterContext ^ filterContext);
protected virtual void HandleNonHttpsRequest (Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext filterContext);
abstract member HandleNonHttpsRequest : Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext -> unit
override this.HandleNonHttpsRequest : Microsoft.AspNetCore.Mvc.Filters.AuthorizationFilterContext -> unit
Protected Overridable Sub HandleNonHttpsRequest (filterContext As AuthorizationFilterContext)



If it was a GET request, default implementation sets Result to a result which will redirect the client to the HTTPS version of the request URI. Otherwise, default implementation sets Result to a result which will set the status code to 403 (Forbidden).

Applies to