First experiment with plugin rewrites

This commit is contained in:
Rick Falkvinge
2015-06-04 18:54:34 +02:00
parent 9105f40e03
commit bef3ba40e6
+12 -2
View File
@@ -30,7 +30,7 @@
// The culture was once set here for localization, but Mono resets CultureInfo before entering the page cycle.
// Setting the CultureInfo has been moved to PageV5Base.OnPreInit().
// TODO: PLUGIN REWRITES
// TODO: PROPER PLUGIN HANDLING
// Testing for page rewrite. Tests IN ORDER.
@@ -38,9 +38,19 @@
if (requestPath == "/Default.aspx")
{
// Mono sends this path instead of the user-submitted "/" received on Windows; compensate for Mono
// Mono sends us the default path instead of the directly-submitted "/" received on Windows; compensate for Mono
requestPath = "/";
}
// Test code with one plugin to see how plugin-override works; intend to replace with generic function later
if (requestPath == "/Signup" && File.Exists (Server.MapPath("/Plugins/FalconwingMedia/Public/Signup.aspx")))
{
Context.RewritePath ("/Plugins/FalconwingMedia/Public/Signup.aspx");
return; // prevent further matching
}
// Rewrite of general URLs
string[] rewriteCandidates =
{