{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/4599","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/4599/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/4599/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/4599/events","html_url":"https://github.com/aspnet/Mvc/issues/4599","id":153639278,"number":4599,"title":"FromRoute parameters aren't URL Decoded.","user":{"login":"Zoltu","id":886059,"avatar_url":"https://avatars.githubusercontent.com/u/886059?v=3","gravatar_id":"","url":"https://api.github.com/users/Zoltu","html_url":"https://github.com/Zoltu","followers_url":"https://api.github.com/users/Zoltu/followers","following_url":"https://api.github.com/users/Zoltu/following{/other_user}","gists_url":"https://api.github.com/users/Zoltu/gists{/gist_id}","starred_url":"https://api.github.com/users/Zoltu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zoltu/subscriptions","organizations_url":"https://api.github.com/users/Zoltu/orgs","repos_url":"https://api.github.com/users/Zoltu/repos","events_url":"https://api.github.com/users/Zoltu/events{/privacy}","received_events_url":"https://api.github.com/users/Zoltu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Mvc/labels/1%20-%20Ready","name":"1 - Ready","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/Mvc/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/Mvc/milestones/21","html_url":"https://github.com/aspnet/Mvc/milestones/1.0.0","labels_url":"https://api.github.com/repos/aspnet/Mvc/milestones/21/labels","id":1641505,"number":21,"title":"1.0.0","description":null,"creator":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":52,"state":"open","created_at":"2016-03-13T21:27:04Z","updated_at":"2016-05-25T01:25:42Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2016-05-08T06:21:37Z","updated_at":"2016-05-25T01:42:12Z","closed_at":null,"body":"```c#\r\n[HttpGet]\r\n[Route(\"\")]\r\npublic async Task<IActionResult> GetValue([FromQuery(Name = \"value\")] String value) { ... }\r\n\r\n[HttpGet]\r\n[Route(\"{value}\")]\r\npublic async Task<IActionResult> GetValue([FromRoute(Name = \"value\")] String value) { ... }\r\n```\r\n\r\nIn the first example, a URL encoded string passed as the `value` query string parameter will be decoded before being passed into the `GetValue` function.\r\n\r\nIn the second example, a URL encoded string passed as a route segment will **NOT** be URL decoded before being passed to the `GetValue` function.\r\n\r\nThis behavior is unexpected, I would expect both Route and Query parameters to be URL decoded before being passed to the function.\r\n\r\nIf this is expected behavior, is there a workaround or a way to tell the route to decode before passing the parameter through?  The problem is made more complex in my real world example because the route parameter is a URL and I want the parameter to be a `Uri` rather than a `String`.  My current solution is to accept a `String` parameter and then construct a `new Uri(value)` out of it.  However, this means I don't benefit from ModelState validation since the only a string is necessary to have the model state be valid."},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/221451435","html_url":"https://github.com/aspnet/Mvc/issues/4599#issuecomment-221451435","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/4599","id":221451435,"user":{"login":"Zoltu","id":886059,"avatar_url":"https://avatars.githubusercontent.com/u/886059?v=3","gravatar_id":"","url":"https://api.github.com/users/Zoltu","html_url":"https://github.com/Zoltu","followers_url":"https://api.github.com/users/Zoltu/followers","following_url":"https://api.github.com/users/Zoltu/following{/other_user}","gists_url":"https://api.github.com/users/Zoltu/gists{/gist_id}","starred_url":"https://api.github.com/users/Zoltu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zoltu/subscriptions","organizations_url":"https://api.github.com/users/Zoltu/orgs","repos_url":"https://api.github.com/users/Zoltu/repos","events_url":"https://api.github.com/users/Zoltu/events{/privacy}","received_events_url":"https://api.github.com/users/Zoltu/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T01:42:12Z","updated_at":"2016-05-25T01:42:12Z","body":"https://github.com/aspnet/KestrelHttpServer/blob/52f4fa91e3f68c5f8a2e726432d85806024fd834/src/Microsoft.AspNet.Server.Kestrel/Http/UrlPathDecoder.cs#L240\r\n\r\nI believe the fix here is the just remove this `if` block and the associated function and adjust test expectations.  Now that we have had the bi \"IIS compat vs RFC\" discussion hopefully that will go smoothly.  :). I'm on my phone on a plane, otherwise I would do the PR myself now."}}
{"actor":{"display_login":"Zoltu"}}