English 中文(简体)
需求 Ssl mvc Depende:working with returl Url
原标题:requireSsl mvc attribute : working with returlUrl

我对我的账户控制人有[要求]。

看来,除原木行动外,所有行动都在发挥作用。 我认为,这是因为把 log行动称为 f:

    new { controller = "Account", returnUrl = HttpContext.Current.Request.RawUrl }


Account/Login?returnUrl...
Account/Login%3freturnUrl...

在改用https时,第二行会造成不实的要求。

EDIT:PROBLEM ISTHAT “?” CHARACTER GETS CONVERTED to "%3F. 我也试图用二、七和三重的中光线这样做。 因此,原因和如何确定?

UPDATE:我确实获得HTTPS,使用国际船舶和公司注册公司,但如上所述,没有使用国际船舶和公司注册公司。 我删除了斜体,完全是在两秒中。 我仍然想知道,为什么它会忙于工作。

最佳回答

由于你指出: 特性在斜线时正在编码。 这是ug。

原始要求书:

UriBuilder builder = new UriBuilder
{
  Scheme = "https",
  Host = filterContext.HttpContext.Request.Url.Host,
  // gets encoded and shouldn t include the ?
  Path = filterContext.HttpContext.Request.RawUrl
};
filterContext.Result = new RedirectResult (builder.ToString ());

或许应该改为类似的东西。

UriBuilder builder = new UriBuilder
{
 Scheme = "https",
 Host = filterContext.HttpContext.Request.Url.Host,
 Path = filterContext.HttpContext.Request.Path,
 Query = filterContext.HttpContext.Request.QueryString.ToString ()
};
filterContext.Result = new RedirectResult (builder.ToString ());
问题回答

暂无回答




相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签