Backslashes treated / converted to slashes

Hi I have an input dto like this

[Route("/users/named/{UserName}", Verbs = “GET”)]
public class FindUser : IReturn
{
public string UserName { get; set; }
}

if I provide as username = “\domain\username” on the caller side I get a 404 as if the back slash was treated as as slash …

I then changed the rout in this way
[Route("/users/named/{UserName*}", Verbs = “GET”)] / / add wildcard

Now I don’t get 404 but in the UserName on the server side a receive “domain/username” … that is , the \ is turned into a / …
I verified with fiddler that , on the client side , the correct backslash is sent

Is it a bug ? I s there a way to get the \ on the input dto ?

Thank you
Enrico

Don’t put it on the /path/info, send user data on the QueryString.

Unfortunately, the api signature is public and used all over by clients we don’t control …
I cannot move the parameter from path to querystring.
Is it a bug that SStack changes \ to / … or is it the desired behaviour ? and if so why ?

thank you
Enrico

This is the default behavior for ASP.NET, you shouldn’t use them in the /path/info.

This workaround in your Web.config may work:

<uri> 
    <schemeSettings>
        <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
    </schemeSettings>
</uri>