1

I have a action method which receives IP as parameter.

[HttpGet]
[Route("lookup/{ipAddress}")]
public string Get(string ipaddress)
{
    return ipaddress;
}

Problem is when the api is called with IPV6 Compact in parameter ending with : (colon), the call doesn't reach the action and getting 500 internal server error with no detail.

Works fine with local machine Using VS 2013 but when deploy to Azure as AppService IPV6 gives Internal Server Error.

Already added the requestPathInvalidCharacters

<system.web>
    <compilation debug="true" targetFramework="4.5" />
    <customErrors mode="Off" />
    <httpRuntime targetFramework="4.5" requestPathInvalidCharacters="&lt;,&gt;,*,%,&amp;,\,?" />
</system.web>

And also set the

<modules runAllManagedModulesForAllRequests="true">

Works fine on local IIS and IIS express but when deployed to Azure Website api is not working.

Nkosi
  • 235,767
  • 35
  • 427
  • 472
Muhammad Zeeshan
  • 293
  • 2
  • 3
  • 8

1 Answers1

0

Could you try:

Change config string to the <... requestValidationMode="2.0" requestPathInvalidCharacters="*,:,&,\" ...>, what happens? That problem is discussed in the Internet, and some ways to fix are there, for example here:

http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx

Using a colon (:) in a url with ASP.NET/IIS

ASP.NET MVC Colon in URL

2) Encode/decode it into the other unicode character

Community
  • 1
  • 1
Alex Belotserkovskiy
  • 4,012
  • 1
  • 13
  • 10