Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Encoding a slash as %2F in URI produces unexpected escaped character in route value #502

Closed
@epsitec

Description

@epsitec

I am using RouteBuilder.MapGet() with this pattern:

address/{zip}/{town}

and I need to be able to pass it a town name which contains a / (such as Belmont/Lausanne) - which is done by using the address/1092/Belmont%2FLausanne. The routing works, however, the route value for town is returned with the string Belmont%2FLausanne.

If I use %25 or other characters which need to be escaped in the URI, they get automatically decoded by the router and returned as their corresponding characters in the route value. The only exception seems to be %2F.

In #363 someone suggested to use a Replace("%2F", "/") but this is just an ugly hack, because it would produce incorrect output for an URI containing %25 followed by 2F ("%252F" should map to "%2F" but with the hack, it would be changed to "/").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions