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.

Attribute route wildcard does not work #4256

@anfomin

Description

@anfomin

Simple controller:

using Microsoft.AspNetCore.Mvc;

namespace WebApplication1.Controllers
{
    [Route("")]
    public class HomeController : Controller
    {
        [HttpGet("{*path}")]
        public IActionResult Index(string path)
        {
            return Content("Path: " + path);
        }
    }
}

I'm running DNX 1.0.0-rc2-16595 and wildcard does not work if mapped via attributes.

  • path /a => "Path: a"
  • path /a/a => 404

If I map routes in startup.cs then it works:

app.UseMvc(routes =>
{
    routes.MapRoute("Default",
        "{*path}",
        new { controller = "Home", action = "Index" });
    });
});

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions