Skip to content

Commit acd5186

Browse files
committed
Introduced bypass for legacy *.axd files
By registering a route, we were introducing a conflict with the legacy `*.axd` virtual resources used by **ASP.NET Web Forms** to deliver e.g. form validation scripts and AJAX "Web Method" handlers. Technically, we don't need any routes registered here, since the **OnTopic Editor** doesn't use them itself, and the host site isn't actually hosting a real **OnTopic** implementation. That said, I'm keeping in the `Ignore()` rule since it's an easy detail to overlook; this way, anyone having issues setting this up will have some guidance.
1 parent a59c7dc commit acd5186

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

OnTopic.Editor.Web.Host/Global.asax.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,9 @@ protected void Application_Start(object sender, EventArgs e) {
5050
/*------------------------------------------------------------------------------------------------------------------------
5151
| REGISTER ROUTES
5252
\-----------------------------------------------------------------------------------------------------------------------*/
53-
RegisterRoutes(RouteTable.Routes);
53+
RouteTable.Routes.Ignore("{resource}.axd/{*pathInfo}");
5454

5555
}
5656

57-
/*==========================================================================================================================
58-
| METHOD: REGISTER ROUTES
59-
>===========================================================================================================================
60-
| Establishes URL routes and maps them to the appropriate page handlers.
61-
\-------------------------------------------------------------------------------------------------------------------------*/
62-
void RegisterRoutes(RouteCollection routes) {
63-
routes.Add(
64-
"TopicUrl",
65-
new Route(
66-
"{rootTopic}/{*path}",
67-
new TopicsRouteHandler()
68-
)
69-
);
70-
}
71-
7257
} //Class
7358
} //Namespace

0 commit comments

Comments
 (0)