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

MVC not honoring attribute route default values for URL matching #4447

Closed
rynowak opened this issue Apr 11, 2016 · 1 comment
Closed

MVC not honoring attribute route default values for URL matching #4447

rynowak opened this issue Apr 11, 2016 · 1 comment
Assignees
Milestone

Comments

@rynowak
Copy link
Member

rynowak commented Apr 11, 2016

See: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/Internal/AttributeRoute.cs#L14

MVC isn't propagating the default values from a URL template. That means that code like:

        [HttpGet("/TeamName/{*Name=DefaultName}/")]
        public ActionResult GetTeam(string name)
        {
        }

will match /TeamName but will always have a default value of null for name

The fix here to pass routeInfo.Defaults + the secret route token.

@rynowak rynowak changed the title MVC not honoring attribute route default values MVC not honoring attribute route default values for URL matching Apr 11, 2016
@Eilon Eilon added this to the 1.0.0-rc2 milestone Apr 11, 2016
@rynowak
Copy link
Member Author

rynowak commented Apr 11, 2016

3ec60a0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants