All pastes #246900 Raw Edit

Unnamed

public text v1 · immutable
#246900 ·published 2006-11-12 20:44 UTC
rendered paste body
Index: HttpContext.cs
===================================================================
--- HttpContext.cs      (revision 67738)
+++ HttpContext.cs      (working copy)
@@ -485,14 +485,38 @@
 
                public void RewritePath (string path)
                {
+#if NET_2_0
+                       RewritePath (path, true);
+#else
+                       RewritePath (path, false);
+#endif
+               }
+
+               public void RewritePath (string filePath, string pathInfo, string queryString)
+               {
+                       RewritePath (filePath, pathInfo, queryString, false);
+               }
+
+#if NET_2_0
+               public
+#else
+               internal
+#endif
+               void RewritePath (string path, bool rebaseClientPath)
+               {
                        int qmark = path.IndexOf ('?');
                        if (qmark != -1)
-                               RewritePath (path.Substring (0, qmark), "", path.Substring (qmark + 1));
+                               RewritePath (path.Substring (0, qmark), "", path.Substring (qmark + 1), rebaseClientPath);
                        else
-                               RewritePath (path, null, null);
+                               RewritePath (path, null, null, rebaseClientPath);
                }
 
-               public void RewritePath (string filePath, string pathInfo, string queryString)
+#if NET_2_0
+               public
+#else
+               internal
+#endif
+               void RewritePath (string filePath, string pathInfo, string queryString, bool setClientFilePath)
                {
                        filePath = UrlUtils.Combine (Request.BaseVirtualDir, filePath);
                        if (!filePath.StartsWith (HttpRuntime.AppDomainAppVirtualPath))
@@ -506,15 +530,11 @@
 
                        if (queryString != null)
                                Request.QueryStringRaw = queryString;
-               }
-
 #if NET_2_0
-               [MonoTODO]
-               public void RewritePath (string path, bool rebaseClientPath)
-               {
-                       throw new NotImplementedException ();
+                       if (setClientFilePath)
+                               Request.SetFilePath (filePath);
+#endif
                }
-#endif
 
 #region internals