Correcting the slashes in paths for specflow tests.

Helps to correct the invalid values (according to Url.IsLocalUrl) for the return
URLs we've been seeing in the spec tests. Gets the "works on my box" stamp of approval.

--HG--
branch : 1.x
This commit is contained in:
Nathan Heskew
2011-04-08 11:05:19 -07:00
parent 291f1b3503
commit 64e0bb1048

View File

@@ -23,15 +23,15 @@ namespace Orchard.Specs.Hosting {
var details = new RequestDetails {
HostName = webHost.HostName,
UrlPath = urlPath,
UrlPath = urlPath.Replace('\\', '/'),
};
int queryIndex = urlPath.IndexOf('?');
if (queryIndex >= 0) {
details.UrlPath = urlPath.Substring(0, queryIndex);
details.UrlPath = urlPath.Substring(0, queryIndex).Replace('\\', '/');
details.Query = urlPath.Substring(queryIndex + 1);
}
details.Page = (isHomepage ? "" : physicalPath.Combine(details.UrlPath.TrimStart('/', '\\')).GetRelativePath(physicalPath).ToString());
details.Page = (isHomepage ? "" : physicalPath.Combine(details.UrlPath.TrimStart('/', '\\')).GetRelativePath(physicalPath).ToString()).Replace('\\','/');
if (!string.IsNullOrEmpty(webHost.Cookies)) {
details.RequestHeaders.Add("Cookie", webHost.Cookies);