문제

I have a basic WebAPI OData application that seems to refuse to route requests to my controller if the parameter has a '.' in it.

For example:

http://localhost.com/vroot/odata/foo('abc') <== routes correctly

http://localhost.com/vroot/odata/foo('a.bc') <== returns a 404 error

I get the same 404 error even if I replace the '.' with a %2E.

http://localhost.com/vroot/odata/foo('a%2Ebc') <== returns a 404 error

Is this a generally understood problem in WebAPI OData?

Any ideas on what might be going on (or possibly how to work around this ?)

도움이 되었습니까?

해결책

Dots in request urls are interpreted differently by IIS, so try adding the following setting in web.config:

<modules>
  <remove name="UrlRoutingModule-4.0" />
  <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>

(From here: http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html )

Some posts related to your issue:
Dots in URL causes 404 with ASP.NET mvc and IIS

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top