IIS treats double-encoded forward slashes in URLs differently on the first request than it does on subsequent requests

后端 未结 2 795
花落未央
花落未央 2021-01-05 17:33

Recently my team was asked to implement an HttpModule for an ASP.NET MVC application that handled double-encoded URLs on IIS 7 and .NET 3.5. Here\'s the crux of the problem

2条回答
  •  旧巷少年郎
    2021-01-05 18:07

    Request.Url can be decoded already - I wouldn't trust it for what you are doing.

    See the internal details at: Querystring with url-encoded ampersand prematurely decoded within Request.Url

    The solution is to access the values directly via Request.RawUrl.

    I realize your prob is with the path, but it seems the same thing is going on. Try the RawUrl - see if it works for you instead.

提交回复
热议问题