Pushing debug code to Sandbox

This commit is contained in:
Rick Falkvinge
2015-06-04 16:56:58 +02:00
parent 9a1f51a3f0
commit 2a05eb3bb0
+10
View File
@@ -47,13 +47,23 @@
"/Pages/v5{0}" // for dev.swarmops.com/Ledgers/Json-SomethingData.aspx
};
File.AppendAllText ("/etc/swarmops/debug.txt", "\n---Debugging: PATH is " + Request.Path +"\n");
foreach (string stringCandidate in rewriteCandidates)
{
string rewrittenCandidate = String.Format (stringCandidate, Request.Path);
File.AppendAllText ("/etc/swarmops/debug.txt", "Testing for " + rewrittenCandidate);
if (File.Exists (Server.MapPath (rewrittenCandidate)))
{
File.AppendAllText ("/etc/swarmops/debug.txt", " - HIT! Recontexting\n");
Context.RewritePath (rewrittenCandidate);
break;
}
File.AppendAllText ("/etc/swarmops/debug.txt", "\n");
}
}