0

I have some really strange behavior happening maybe its by design but it doesnt make sense to me

I have a simple endpoint

 [Route("EmailUsed/{emailaddress}")]
 [HttpGet]
 [AllowAnonymous]
 public IHttpActionResult IsEmailInUse(string emailaddress)
 {
   return Ok(true);
 }

When I try calling the endpoint I get a 404 whenever I try adding a . within the emailaddress parameter e.g. email@gmail.com if I pass the parameter of email@gmailcom it works fine.

Am I overlooking something really stupid here?

Diver Dan
  • 9,953
  • 22
  • 95
  • 166
  • 3
    possible duplicate of [Dots in URL causes 404 with ASP.NET mvc and IIS](http://stackoverflow.com/questions/11728846/dots-in-url-causes-404-with-asp-net-mvc-and-iis) – Justin Helgerson May 28 '14 at 21:10

1 Answers1

-1

This typically has to do with input validation at the IIS level. You can disable it in Web.config and you may need to play with it a bit to find the right Web.config value to make it work. I believe it's:

<system.web>
    <pages validateRequest="false" />
    <httpRuntime requestValidationMode="2.0" />
</system.web>
Haney
  • 32,775
  • 8
  • 59
  • 68