How do you enforce lowercase routing in ASP.NET Core?

前端 未结 6 1879
Happy的楠姐
Happy的楠姐 2020-12-04 12:11

In ASP.NET 4 this was as easy as routes.LowercaseUrls = true; in the RegisterRoutes handler for the app.

I cannot find an equivalent in ASP

6条回答
  •  眼角桃花
    2020-12-04 12:16

    For identity, @Jorge Yanes Diez answer doesn't work in ASP.NET Core 2.2 (I think 2.x), so if you use Identity and ASP.NET Core 2.2 (2.x) here is the solution:

    services.ConfigureApplicationCookie(options =>
    {
        options.LoginPath = "/account/login";
        options.ReturnUrlParameter = "returnurl";
        ...
    });
    

    Ref: Configure ASP.NET Core Identity

提交回复
热议问题