Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 在elmah.mvc中添加对elmah控制器的SSL支持_Asp.net Mvc_Elmah.mvc - Fatal编程技术网

Asp.net mvc 在elmah.mvc中添加对elmah控制器的SSL支持

Asp.net mvc 在elmah.mvc中添加对elmah控制器的SSL支持,asp.net-mvc,elmah.mvc,Asp.net Mvc,Elmah.mvc,我想为Elmah.MVC包中的Elmah控制器要求SSL。有人已经这样做了吗? 到目前为止,我可以通过要求授权来保护它,但我希望仅通过SSL返回elmah日志数据。打开elmah控制器并添加以下属性: [RequireHttps] 例如: using System.Web.Mvc; namespace Elmah.Mvc { [Authorize] [RequireHttps] public class ElmahController : Controller

我想为Elmah.MVC包中的Elmah控制器要求SSL。有人已经这样做了吗?
到目前为止,我可以通过要求授权来保护它,但我希望仅通过SSL返回elmah日志数据。

打开elmah控制器并添加以下属性:

[RequireHttps]
例如:

using System.Web.Mvc;

namespace Elmah.Mvc
{
    [Authorize]
    [RequireHttps]
    public class ElmahController : Controller
    {
        public ActionResult Index(string resource)
        {
            /* Adapted by Alexander Beletsky */
            return new ElmahResult();
        }

        public ActionResult Detail(string resource)
        {
            /* Adapted by Alexander Beletsky */
            return new ElmahResult();
        }
    }
}

ELMAH控制器的源代码取自

打开ELMAH控制器并添加以下属性:

[RequireHttps]
例如:

using System.Web.Mvc;

namespace Elmah.Mvc
{
    [Authorize]
    [RequireHttps]
    public class ElmahController : Controller
    {
        public ActionResult Index(string resource)
        {
            /* Adapted by Alexander Beletsky */
            return new ElmahResult();
        }

        public ActionResult Detail(string resource)
        {
            /* Adapted by Alexander Beletsky */
            return new ElmahResult();
        }
    }
}

ELMAH控制器的源代码取自

是的,谢谢,我想知道是否有人扩展了ELMAH配置以启用Https。我认为没有人专门这么做,但很高兴这个小补丁为您解决了!是的,谢谢,我想知道是否有人扩展了ELMAH配置以启用Https。我认为没有人专门这么做,但很高兴这个小补丁为您解决了!