.net核心api中有一个具有已定义版本的控制器,以便可以访问诸如/api/v2.0/controller/
之类的宁静端点。问题在于,具有类似/api/v99.0/controller/
这样的不同版本的请求也将被重定向到第一个,我想返回404 not found错误。
The controller is decorated like this:
[Authorize]
[ApiVersion("2.0")]
[ApiController]
[Route("api/v{version:apiVersion}/[controller]")]
And the action is decorated with just this
[HttpGet]