Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nul800sebastiaan/c3459731791577582e38254fa6e0ccd6 to your computer and use it in GitHub Desktop.
Save nul800sebastiaan/c3459731791577582e38254fa6e0ccd6 to your computer and use it in GitHub Desktop.
Example of catch-all route and added constraints
RouteTable.Routes.MapRoute("Default", "{controller}/{action}/{id}",
//Defaults
new { controller = "Home", action = "Index", id = "" },
//Constraints (controller cannot start with UmbProfile, UmbRegister, UmbLogin, UmbLoginStatus or Tags)
new { controller = "^(?!(UmbProfile|UmbRegister|UmbLogin|UmbLoginStatus|Tags))" });
@nul800sebastiaan
Copy link
Author

Please note: this code is part of a security advisory we posted today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment