Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was 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

Description

@rynowak

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions