2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web / System.Web / HttpResponse.cs
index fa8c2892af8873a84c38bf371af0031e02bce18c..734c2018db7a4cf2a6ec79ff1dfa8c58a900aabf 100644 (file)
@@ -356,8 +356,15 @@ namespace System.Web
                                virtualPath = UrlUtils.Reduce (virtualPath);
                        }
 
-                       if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) > 0)
-                               virtualPath = UrlUtils.Combine (app_path_mod, virtualPath);
+                       if (app_path_mod != null && virtualPath.IndexOf (app_path_mod) < 0) {
+                               string rvd = _Context.Request.RootVirtualDir;
+                               string basevd = rvd.Replace (app_path_mod, "");
+
+                               if (!virtualPath.StartsWith (basevd))
+                                       return virtualPath;
+
+                               virtualPath = UrlUtils.Combine (rvd, virtualPath.Substring (basevd.Length));
+                       }
 
                        return virtualPath;
                }
@@ -496,10 +503,10 @@ namespace System.Web
                        }
 
                        set {
-                               if (!_expiresInMinutesSet || (value < _expiresInMinutes))\r
-                               {\r
-                                       _expiresInMinutes = value;\r
-                                       Cache.SetExpires(_Context.Timestamp.Add(new TimeSpan(0, _expiresInMinutes, 0)));\r
+                               if (!_expiresInMinutesSet || (value < _expiresInMinutes))
+                               {
+                                       _expiresInMinutes = value;
+                                       Cache.SetExpires(_Context.Timestamp.Add(new TimeSpan(0, _expiresInMinutes, 0)));
                                }
                                _expiresInMinutesSet = true;
                        }
@@ -512,10 +519,10 @@ namespace System.Web
                        }
 
                        set {
-                               if (!_expiresAbsoluteSet || value.CompareTo(_expiresAbsolute)<0)\r
-                               {\r
-                                       _expiresAbsolute = value;\r
-                                       Cache.SetExpires(_expiresAbsolute); \r
+                               if (!_expiresAbsoluteSet || value.CompareTo(_expiresAbsolute)<0)
+                               {
+                                       _expiresAbsolute = value;
+                                       Cache.SetExpires(_expiresAbsolute); 
                                }
                                _expiresAbsoluteSet = true;
                        }
@@ -710,6 +717,11 @@ namespace System.Web
                        Clear();
                }
 
+               internal void SetHeadersSent (bool val)
+               {
+                       _bHeadersSent = val;
+               }
+               
                public void ClearHeaders ()
                {
                        if (_bHeadersSent)