From 2a05eb3bb0d7a7c9c63e113fdc8acd0b533c9f1f Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Thu, 4 Jun 2015 16:56:58 +0200 Subject: [PATCH] Pushing debug code to Sandbox --- Site5/Global.asax | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Site5/Global.asax b/Site5/Global.asax index ee9cf424..02b746bd 100644 --- a/Site5/Global.asax +++ b/Site5/Global.asax @@ -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"); } }