Skip to content

FromRoute only partially decodes certain values #4445

Closed
@nikitagon

Description

@nikitagon

The problem I’m having is that we have a code that looks like this:

[FromRoute(Name = "event_name")]
public string EventName
{
    get
    {                
        return _eventName;
    }

The following URL gets passed to it:
something.com/events/0008%20-%2012%2F3%2F2018Existe%20um%20inventario%20incompleto%2C%20deseja%20continar%20%3F%20(Sim)

  • The encoded value passed through the URL is 0008%20-%2012%2F3%2F2018Existe%20um%20inventario%20incompleto%2C%20deseja%20continar%20%3F%20(Sim)
  • FromRoute decodes EventName it to 0008 - 12%2F3%2F2018Existe um inventario incompleto, deseja continar ? (Sim)
  • Expected decoded value of EventName would be 0008 - 12/3/2018Existe um inventario incompleto, deseja continar ? (Sim)

Is there a workaround for that?

<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />

#region Assembly Microsoft.AspNetCore.Mvc.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
// .nuget\packages\microsoft.aspnetcore.mvc.core\2.1.3\lib\netstandard2.0\Microsoft.AspNetCore.Mvc.Core.dll
#endregion

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesquestion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions