Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Web Api and UrlDecode

Is this a bug in the framework?

I have to use HttpUtility.UrlDecode here. I thought things were automatically decoded in MVC.

    public Thingy[] Get(string id)
    {
        var actualId = HttpUtility.UrlDecode(id ?? string.Empty);

        var result = MakeThingy(actualId );
        return result;
    }

I should be able to just do this ...

    public Thingy[] Get(string id)
    {
        var result = MakeThingy(id ?? string.Empty);
        return result;
    }
like image 735
Antony Scott Avatar asked Feb 22 '12 22:02

Antony Scott


1 Answers

It's a known bug. We'll fix it for the next release.

like image 183
marcind Avatar answered Oct 19 '22 23:10

marcind