This is simular to this question:
But I want to do it within the MVC where the "Request" object isn't directly accessable. Is there a method decorator to specify actions that require SSL? How do I get the equivalent of the answer in the mentioned answer within the MVC?
If Not Request.IsLocal AndAlso Not Request.IsSecureConnection Then
Dim ub As var = New UriBuilder(Request.Url)
ub.Scheme = Uri.UriSchemeHttps
ub.Port = -1
' use default port for scheme
Response.Redirect(ub.Uri.ToString(), True)
Return
End If