Corrected urls generation on multi tenants listing with Azure

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-05-11 15:02:43 -07:00
parent 1385bcb8a2
commit e8190f0e32

View File

@@ -4,15 +4,12 @@ using Orchard.Environment.Configuration;
namespace Orchard.MultiTenancy.Extensions { namespace Orchard.MultiTenancy.Extensions {
public static class UrlHelperExtensions { public static class UrlHelperExtensions {
public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) { public static string Tenant(this UrlHelper urlHelper, ShellSettings tenantShellSettings) {
//info: (heskew) might not keep the port insertion around beyond...
var port = urlHelper.RequestContext.HttpContext.Request.Url.Port;
return string.Format( return string.Format(
"http://{0}{2}/{1}", "http://{0}/{1}",
!string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost) !string.IsNullOrEmpty(tenantShellSettings.RequestUrlHost)
? tenantShellSettings.RequestUrlHost ? tenantShellSettings.RequestUrlHost
: urlHelper.RequestContext.HttpContext.Request.Url.Host, : urlHelper.RequestContext.HttpContext.Request.Headers["Host"],
tenantShellSettings.RequestUrlPrefix, tenantShellSettings.RequestUrlPrefix);
port != 80 ? string.Format(":{0}", port) : "");
} }
} }
} }