Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

MapAreaRoute constraint not escaped #4846

Closed
sebastienros opened this issue Jun 10, 2016 · 8 comments
Closed

MapAreaRoute constraint not escaped #4846

sebastienros opened this issue Jun 10, 2016 · 8 comments
Labels
3 - Done bug up-for-grabs Members of our awesome commnity can handle this issue

Comments

@sebastienros
Copy link
Member

On this line:

constraintsDictionary["area"] = areaName;

The area is a string that is used for the defaults, and the constraints. But in the case of constrains the string is evaluated as a regular expression. In my case the are looks like "Orchard.Setup" which would make it not work as expected because of the dot.

@sebastienros
Copy link
Member Author

I would like a solution when on this extension method the constraint would be built using a StringRouteConstraint to exactly match the string passed as the area name. That would be equivalent to a Regex escaped solution, with the perf gain.

@rynowak
Copy link
Member

rynowak commented Jun 10, 2016

Good find

@Eilon Eilon added this to the 1.0.1 milestone Jun 10, 2016
@Eilon Eilon added bug 1 - Ready up-for-grabs Members of our awesome commnity can handle this issue labels Jun 10, 2016
@iscifoni
Copy link
Contributor

iscifoni commented Aug 3, 2016

I would like to do this issue
i have a question, all the contraints are defined into Routing repository, the contraint StringRouteConstraint will be defined on it ? Or StringRouteConstraint will be defined internal class ?

@rynowak
Copy link
Member

rynowak commented Aug 3, 2016

@iscifoni that's a good question

@Eilon - will we want MVC 1.1.0 to require routing 1.1.0? If we're going to add a constraint as general as this, it would be better to define it in routing, but that will make MVC require 1.1.0.

@Eilon
Copy link
Member

Eilon commented Aug 3, 2016

MVC 1.1.x depending on Routing 1.1.x seems perfectly reasonable. Don't we need to do this for @kichalla 's RouteCreationException thing anyway?

@rynowak
Copy link
Member

rynowak commented Aug 3, 2016

Yes we do.

Ok so @iscifoni - you'd want to add StringRouteConstraint to routing first, and then add usage of it to MVC.

@Eilon are you concerned about the breaking change behavior change here? We never intended to treat the area name as a regex.

@Eilon
Copy link
Member

Eilon commented Aug 3, 2016

Yeah let's just fix this and have it be treated as a string. No idea why it was ever treated as a regex - I cannot possibly imagine that it was deliberate.

@rynowak
Copy link
Member

rynowak commented Aug 8, 2016

Fixed by 6e5187c and aspnet/Routing@88de3d5

@rynowak rynowak closed this as completed Aug 8, 2016
@rynowak rynowak added 3 - Done and removed 1 - Ready labels Aug 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - Done bug up-for-grabs Members of our awesome commnity can handle this issue
Projects
None yet
Development

No branches or pull requests

4 participants