我在我的 ASP.NET 应用程序中映射了 url,如下所示:
context.MapRoute(
"Product_v1_DataExchange",
"v1/xch",
new { controller = "Data", action = "Exchange" });
context.MapRoute(
"Product_v1_Register",
"v1/register",
new { controller = "Registration", action = "Register" });
我只想按照以下网址工作:
http://servername/v1/xch
http://servername/v1/register
但以下网址也可以正常工作:
http://servername/v1/xch?test
http://servername/v1/register/?*e/
http://servername/v1//./register/./?*
如何设置约束以便只允许定义的静态 url?