X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web%2FSystem.Web.Hosting%2FSimpleWorkerRequest.cs;h=0b8b450ecc44e3507a67dac8e9e379fd40930c0f;hb=ccdf8c3274d1793ffeddedfd784d49707feea62a;hp=dc3c61107719d0b669de8da5de2e53623268091e;hpb=6110fc90713ce59ff0996fcd3520e09a96575820;p=mono.git diff --git a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs index dc3c6110771..0b8b450ecc4 100644 --- a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs +++ b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs @@ -57,7 +57,7 @@ namespace System.Web.Hosting { // computed string raw_url; - + // // Constructor used when the target application domain // was created with ApplicationHost.CreateApplicationHost @@ -127,11 +127,9 @@ namespace System.Web.Hosting { return null; } } -#if NET_2_0 public override string RootWebConfigPath { get { return WebConfigurationManager.OpenWebConfiguration ("~").FilePath; } } -#endif public override void EndOfRequest () { @@ -172,7 +170,7 @@ namespace System.Web.Hosting { else local_page = page; - string path = UrlUtils.Combine (app_physical_dir, local_page); + string path = Path.Combine (app_physical_dir, local_page); if (SecurityManager.SecurityEnabled && (path != null) && (path.Length > 0)) { new FileIOPermission (FileIOPermissionAccess.PathDiscovery, path).Demand (); } @@ -255,13 +253,17 @@ namespace System.Web.Hosting { { if (!hosted) return null; - + if (path != null && path.Length == 0) + return app_physical_dir; + if (!path.StartsWith (app_virtual_dir)) throw new ArgumentNullException ("path is not rooted in the virtual directory"); string rest = path.Substring (app_virtual_dir.Length); if (rest.Length > 0 && rest [0] == '/') rest = rest.Substring (1); + if (Path.DirectorySeparatorChar != '/') // for windows suport + rest = rest.Replace ('/', Path.DirectorySeparatorChar); return Path.Combine (app_physical_dir, rest); }