alexbeletsky / elmah-mvc

Painless integration of ELMAH into ASP.NET MVC application
http://nuget.org/packages/Elmah.MVC
Apache License 2.0
266 stars 61 forks source link

Ending slash in URL #9

Closed alexbeletsky closed 12 years ago

alexbeletsky commented 12 years ago

Still two minor corrections for that version:

In ElmahResult, in subroutine public override void ExecuteResult(ControllerContext context)

After this statement there if (!string.IsNullOrEmpty(m_resouceType)) {...} add

        // BugFix
        if (context.HttpContext.Request.RawUrl != null)
        {
            if (context.HttpContext.Request.RawUrl.EndsWith("/elmah/", StringComparison.OrdinalIgnoreCase))
                context.HttpContext.RewritePath(context.HttpContext.Request.RawUrl.TrimEnd('/'));
        }

And in ElmahController.cs, public ActionResult Index(string type)

{

return new ElmahResult(type);

}

instead of

public ActionResult Index()

This will make it possible that it also works with this url: http://localhost:57443/elmah/ instead of just http://localhost:57443/elmah

and also

http://localhost:57443/admin/elmah/ instead of just http://localhost:57443/admin/elmah

Otherwise, it doesn't find the stylesheets when the url ends with / because the url will be /elmah//stylesheet.css. Just my additional 5 cents ;)

alexbeletsky commented 12 years ago

In-directly fixed with new ElmahResult code.