Last active
July 30, 2019 07:27
-
-
Save nul800sebastiaan/c3459731791577582e38254fa6e0ccd6 to your computer and use it in GitHub Desktop.
Example of catch-all route and added constraints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))" }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note: this code is part of a security advisory we posted today.